From 1f827723c08b3ac40efaf2c42d334319c880c980 Mon Sep 17 00:00:00 2001 From: dichgrem Date: Thu, 1 Jan 2026 15:50:48 +0800 Subject: [PATCH] feat:sort_by_year --- templates/archive.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/templates/archive.html b/templates/archive.html index af9df6e..8b98232 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -10,6 +10,22 @@ {% set section = get_section(path="_index.md") %} - {{ post_macros::list_posts(pages=section.pages) }} + {% set pages_by_year = section.pages | group_by(attribute="year") %} + {%- for year, pages_in_year in pages_by_year %} +

{{ year }}

+ + {%- endfor %} {% endblock content %}