aboutsummaryrefslogtreecommitdiff
path: root/content/templates/blog.html
blob: 17f887008cced48b0307708a96d4d19142f831b3 (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
{# The blog index at /blog/, mirroring theme/templates/blog.html.
   Separate from list.html because the live page carries its own prose. #}
{% extends "base.html" %}

{#- Group the list under year headings, as the live site does. Set to false for one flat
    list; styles.css has .post-list-year either way. `page.year` comes from #+DATE:, and
    a post without one lands in its own group at the end rather than being dropped. #}
{%- set group_by_year = true %}

{% block main %}
<h1>{{ page.title }}</h1>
<p>Use <code>&#8984; F</code> / <code>Ctrl F</code> to search &middot; <a href="{{ root }}feed.xml">RSS Feed</a></p>
<p>Want to browse by topic instead? Head over to the <a href="{{ root }}tags/index.html">tags</a> page.</p>
<ul class="post-list">
{%- if group_by_year %}
{%- for year, posts in pages | groupby("year") | reverse %}
<li class="post-list-year">{{ year if year else "undated" }}</li>
{%- for entry in posts %}
<li class="post-list-item">
{%- if entry.date_iso %}<time datetime="{{ entry.date_iso }}">{{ entry.date_iso }}</time>{% endif %}
<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a>
</li>
{%- endfor %}
{%- endfor %}
{%- else %}
{%- for entry in pages %}
<li class="post-list-item">
{%- if entry.date_iso %}<time datetime="{{ entry.date_iso }}">{{ entry.date_iso }}</time>{% endif %}
<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a>
</li>
{%- endfor %}
{%- endif %}
</ul>
{% endblock %}