summaryrefslogtreecommitdiff
path: root/templates/taxonomy_list.html
blob: 222711ced368e3c9eec4d28e619625754ed19092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% extends "base.html" %}

{% block content %}
<section class="archive">
    {% for term in terms %}
    <ul class="post-archive">
        {# Group the posts by year #}
        {% set map = term.pages | group_by(attribute="year") %}
        {% set_global years = [] %}
        {# Convert the years map to an array (since maps do not have determined order) #}
        {% for year, ignored in map %}
        {% set_global years = years | concat(with=year) %}
        {% endfor %}

        <div class="term-name"><a href="{{ term.permalink }}" class="term-name">#{{ term.name }}</a></div>

        {% for year in years | sort | reverse %}
        <div class="years">
            {% set posts = map[year] %}
            <div class="year">{{ year }}</div>
            {% for post in posts %}
            <li class="post-item">
                <span class="post-date">{{ post.date | date(format="%m/%d") }}</span>
                <a href="{{ post.permalink }}" class="post-title">{{ post.title }}</a>
            </li>
            {% endfor %}
        </div>
        {% endfor %}
    </ul>
    {% endfor %}
</section>
{% endblock %}