blob: 79feb9d515a89bb2399f997dbc6f8b977cdec34a (
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
|
{% extends "base.html" %}
{% block content %}
<section class="archive">
<ul class="post-archive">
{# Group the posts by year #}
{% set map = get_section(path="_index.md") | get(key="pages") | group_by(attribute="year") %}
{# Convert the years map to an array (since maps do not have determined order) #}
{% set_global years = [year for year, ignored in map] %}
{% 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>
</section>
{% endblock %}
|