aboutsummaryrefslogblamecommitdiff
path: root/_includes/categories.html
blob: 7c91a939b9227ea46b0350ce0f0213ec704c6428 (plain) (tree)





























                                                                                                                                      
{% 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 %}
  <h2 id="{{ category }}">
    <a href="#{{ category }}">{{ category }}</a>:
  </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 %}
    {% endfor %}
  </ul>
{% endfor %}