From 23d62aaa39dae753d39dcd596b962ccc1c5cdb36 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Wed, 2 Sep 2026 15:49:49 +0800 Subject: templates: migrate to zola 0.23 tera v1->v2 https://github.com/getzola/zola/issues/3235 https://github.com/Keats/tera/blob/master/MIGRATION.md --- templates/components.html | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 templates/components.html (limited to 'templates/components.html') diff --git a/templates/components.html b/templates/components.html new file mode 100644 index 0000000..5e07ac0 --- /dev/null +++ b/templates/components.html @@ -0,0 +1,61 @@ +{% component format_chinese_date(year, month, day) %} +{% set lut1 = ["〇", "一", "二", "三", "四", "五", "六", "七", "八", "九"] %} +{% set lut2 = [ + '一', '二', '三', '四', + '五', '六', '七', '八', + '九', '十', '十一', '十二', + '十三', '十四', '十五', '十六', + '十七', '十八', '十九', '二十', + '廿一', '廿二', '廿三', '廿四', + '廿五', '廿六', '廿七', '廿八', + '廿九', '三十', '三十一'] %} +{% for c in year | str %}{{ lut1 | nth(n=c | int) }}{% endfor %}年{{ lut2 | nth(n=month-1)}}月{{ lut2 | nth(n=day-1) }}日 +{% endcomponent format_chinese_date %} + +{% component post_meta(post, chinese_date, expand) %} +
+ {% if expand %}
{% else %}{% endif %} + {% for author in post.authors %} + {{ author }} + {% endfor %} + {% if expand %}
{% else %}{% endif %} + {% if expand %}
{% else %}{% endif %} + {% if chinese_date %} + {{ }} + {% else %} + {{ post.date|date(format="%Y/%m/%d") }} + {% endif %} + {% if expand %}
{% else %}{% endif %} + {% if expand %}
{% else %}{% endif %} + {% if post.taxonomies.tags %} + {% for tag in post.taxonomies.tags %} + #{{ tag }} + {% endfor %} + {% endif %} + {% if expand %}
{% else %}{% endif %} +
+{% endcomponent post_meta %} + +{% component shikwasa(subtitle, author, image, media) %} + + +
+ +
+{% endcomponent shikwasa %} -- cgit v1.2.3