From 9b6e0c8cfa89eb5073e19c9fdc7c912b82a5fcec Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 10 Oct 2020 22:42:44 -0300 Subject: Add basic categories page support --- _includes/categories.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 _includes/categories.html (limited to '_includes/categories.html') diff --git a/_includes/categories.html b/_includes/categories.html new file mode 100644 index 0000000..7c91a93 --- /dev/null +++ b/_includes/categories.html @@ -0,0 +1,30 @@ +{% assign articles_with_categories = "" | split:"" %} +{% for article in site.articles %} + {% if article.lang == page.lang %} + {% if article.category %} + {% assign articles_with_categories = articles_with_categories | push:article %} + {% endif %} + {% endif %} +{% endfor %} +{% assign articles_with_categories = articles_with_categories | reverse %} + +{% assign categories = "" | split:"" %} +{% for article in articles_with_categories %} + {% assign categories = categories | push:article.category %} +{% endfor %} + +{% assign unique_categories = categories | sort | uniq %} +{% for category in unique_categories %} +

+ {{ category }}: +

+ +{% endfor %} -- cgit v1.2.3