From a0ba466b9e9b3fe02f55f83919210789eae399cb Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Sun, 5 May 2024 00:12:46 +0800 Subject: templates/{archive,taxonomy}: refactor and enforce a coherent style --- templates/taxonomy_list.html | 32 ++++++++++++++++++++++++++------ templates/taxonomy_single.html | 12 +++++++----- 2 files changed, 33 insertions(+), 11 deletions(-) (limited to 'templates') diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 9182c43..222711c 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -1,12 +1,32 @@ {% extends "base.html" %} {% block content %} -
-

Tags

-
+
{% for term in terms %} -
#{{ term.name }}
+
    + {# Group the posts by year #} + {% set map = term.pages | group_by(attribute="year") %} + {% set_global years = [] %} + {# Convert the years map to an array (since maps do not have determined order) #} + {% for year, ignored in map %} + {% set_global years = years | concat(with=year) %} + {% endfor %} + + + + {% for year in years | sort | reverse %} +
    + {% set posts = map[year] %} +
    {{ year }}
    + {% for post in posts %} +
  • + + {{ post.title }} +
  • + {% endfor %} +
    + {% endfor %} +
{% endfor %} -
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 9dbf19f..dec55cc 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -9,20 +9,22 @@ {% set pages = term.pages %} {% endif %}
-
{{ term.name }}
+
+ #{{ term.name }} +
{% for post in pages %}
{{ post.title }}
- {{ post.summary | safe }} - More + {{ post.summary | safe }} + More
{{ macros::post_meta(post=post, chinese_date=config.extra.seje_chinese_date, expand=false) }}
{% endfor %} -{# {{ paginator.next }} #} + {# {{ paginator.next }} #}
{% if paginator %} {% include "paginator.html" %} {% endif %} -{% endblock %} +{% endblock %} \ No newline at end of file -- cgit v1.2.3