The old Pelican theme I used to use for mcol.xyz
git clone https://mcol.xyz/code/rice-theme
Log | Files | Refs | README

commit 72efee194a13d4e12ede9c6d34e3109e19b415c9
parent e4b5247fd6801dc02a7eee3fcadec87e637ae1f7
Author: mcol <mcol@posteo.net>
Date:   Sun,  2 Aug 2020 12:39:40 +0100

add categories to top of notes list

Diffstat:
Mtemplates/archives.html | 33+++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/templates/archives.html b/templates/archives.html @@ -5,19 +5,28 @@ {% block content %} <h1>{{ ARCHIVES_TITLE }}</h1> - <div id=ar> - {% for year, date_year in dates|groupby( 'date.year' )|sort(reverse=True) %} - <div class="ar-yr">{{ year }}</div> - - {% for month, articles in date_year|groupby('date.month')|sort(reverse=True) %} - {% for article in articles %} - <div class="ar-art"> - <a href="/{{ article.url }}">{{ article.title }}</a> - </div> - <div>{{ article.date.strftime('%b %d') }}</div> - {% endfor %} - {% endfor %} +<div id=cats> + By category: + <ul> + {% for category, articles in categories|sort %} + <li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }} ({{ articles|count }})</a></li> {% endfor %} + </ul> +</div> + +<div id=ar> + {% for year, date_year in dates|groupby( 'date.year' )|sort(reverse=True) %} + <div class="ar-yr">{{ year }}</div> + + {% for month, articles in date_year|groupby('date.month')|sort(reverse=True) %} + {% for article in articles %} + <div class="ar-art"> + <a href="/{{ article.url }}">{{ article.title }}</a> </div> + <div>{{ article.date.strftime('%b %d') }}</div> + {% endfor %} + {% endfor %} + {% endfor %} +</div> {% endblock %}