summaryrefslogtreecommitdiff
path: root/templates/blog.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/blog.html')
-rw-r--r--templates/blog.html10
1 files changed, 4 insertions, 6 deletions
diff --git a/templates/blog.html b/templates/blog.html
index f659571..ff44e08 100644
--- a/templates/blog.html
+++ b/templates/blog.html
@@ -15,18 +15,16 @@
<h2>Latest Posts</h2>
<div class="sunken-panel">
<ul class="tree-view" style="height: 8rem; overflow-y: scroll">
- {% set current_year = now() | date(format="%Y") | int %} {% for i in
- range(start=0, end=current_year - 2024) %}
+ {% for year, posts in section.pages | group_by(attribute="year") %}
<li>
<details open>
- <summary><b>{{current_year - i}}</b></summary>
+ <summary><b>{{ year }}</b></summary>
<ul>
- {% for post in section.pages %} {% if post.year == current_year -
- i %}
+ {% for post in posts %}
<li>
<a href="{{post.permalink}}">{{post.title}}</a> - {{post.date}}
</li>
- {% endif %} {% endfor %}
+ {% endfor %}
</ul>
</details>
</li>