aboutsummaryrefslogtreecommitdiffstats
path: root/Peli-Kiera/templates/category.html
blob: 12c566c8a988d5fc3955bd898d1f7674f473490e (plain) (blame)
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
33
34
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Archives{% endblock %}

{% block content %}
    <main>
        <section id="list">
            <h2>{{ category }}</h2>
            <ul>
                {% set new = namespace(p=0) %}
                {% for article in articles_page.object_list %}
                    {% set period = article.date | strftime('%Y') %}
                    {% if period != new.p %}
                        <h3>{{ period }}</h3>
                        <li>
                            <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
                            <time>{{ article.date|strftime('%b %Y') }}</time>
                        </li>
                        {% set new.p = article.date | strftime('%Y') %}
                    {% elif period == new.p %}
                        <li>
                            <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
                            <time>{{ article.date|strftime('%b %Y') }}</time>
                        </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </section>
        {% if articles_page.has_other_pages() %}
            {% include 'pagination.html' %}
        {% endif %}
    </main>
{% endblock %}