diff options
author | EuAndreh <eu@euandre.org> | 2020-11-08 14:22:49 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-11-08 14:22:49 -0300 |
commit | 559b765bf3a73dfbb66a086e841998c030e7a62b (patch) | |
tree | b1bc94107a3e6191ace8399424ea4bd5a30c48f0 | |
parent | Add find -xtype l TIL entry (diff) | |
download | euandre.org-559b765bf3a73dfbb66a086e841998c030e7a62b.tar.gz euandre.org-559b765bf3a73dfbb66a086e841998c030e7a62b.tar.xz |
_includes/categories.html: Allow articles with multiple comma-separated categories
Diffstat (limited to '')
-rw-r--r-- | _includes/categories.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/_includes/categories.html b/_includes/categories.html index 7c91a93..60a6ed6 100644 --- a/_includes/categories.html +++ b/_includes/categories.html @@ -10,7 +10,10 @@ {% assign categories = "" | split:"" %} {% for article in articles_with_categories %} - {% assign categories = categories | push:article.category %} + {% assign article_categories = article.category | split:"," %} + {% for article_category in article_categories %} + {% assign categories = categories | push:article_category %} + {% endfor %} {% endfor %} {% assign unique_categories = categories | sort | uniq %} @@ -20,11 +23,14 @@ </h2> <ul> {% for article in articles_with_categories %} - {% if category == article.category %} - <li> - <a href="{{ article.url | relative_url }}">{{ article.title | escape }}</a> - {% include i18n-date.html date=article.date %} - </li> - {% endif %} + {% assign article_categories = article.category | split:"," %} + {% for article_category in article_categories %} + {% if category == article_category %} + <li> + <a href="{{ article.url | relative_url }}">{{ article.title | escape }}</a> - {% include i18n-date.html date=article.date %} + </li> + {% endif %} + {% endfor %} {% endfor %} </ul> {% endfor %} |