From 5fd8d2fe0fd5cfe3ba3cebc9182233f7fb4478ab Mon Sep 17 00:00:00 2001 From: mayx Date: Sun, 8 Mar 2026 10:54:41 +0000 Subject: Update 2 files - /archives.md - /_data/other_repo_list.csv --- archives.md | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'archives.md') diff --git a/archives.md b/archives.md index 647633b..cfe07ce 100644 --- a/archives.md +++ b/archives.md @@ -5,23 +5,16 @@ title: Archives # Archives -* * * - -{% for post in site.posts %} -{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} -{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} -{% if forloop.first %} - -## {{ this_year }} +--- -{% endif %} +{% assign posts_by_year = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %} -- {{ post.date | date: "%Y/%m/%d" }} - [{{ post.title }}{% if post.layout == "encrypt" %} [加密] {% endif %}]({{ post.url }}) +{% for year in posts_by_year %} -{% if forloop.last %} -{% else %} -{% if this_year != next_year %} +## {{ year.name }} (共 {{ year.items | size }} 篇) -## {{next_year}} +{% for post in year.items %} +- {{ post.date | date: "%Y/%m/%d" }} - [{{ post.title }}{% if post.layout == "encrypt" %} [加密]{% endif %}]({{ post.url }}) +{% endfor %} -{% endif %} {% endif %} {% endfor %} +{% endfor %} \ No newline at end of file -- cgit v1.2.3