aboutsummaryrefslogtreecommitdiff
path: root/development/libs/barrel/docs/blue-penguin/templates/archives.html
blob: 73c53bae8b0919c8a7e41735d50b75f9030c947c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{% extends "base.html" %}

{% block title %}{{ SITENAME }} | Archives{% endblock %}
{% block content %}

    <h1>Archives</h1>

    {# based on http://stackoverflow.com/questions/12764291/jinja2-group-by-month-year #}

    {% for year, year_group in dates|groupby('date.year')|reverse %}
        {% for month, month_group in year_group|groupby('date.month')|reverse %}
            <h4 class="date">{{ (month_group|first).date|strftime('%b %Y') }}</h4>
            <div class="post archives">
                <ul>
                {% for article in month_group %}
                    <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li>
                {% endfor %}
                </ul>
            </div>
        {% endfor %}
    {% endfor %}
{% endblock %}