From 302b179aa98c8693ce01bc77a56c3e92d0704af0 Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 18:14:44 +0800 Subject: feat: show fictions individually in term page TODO need to refactor term.html, too many repeated code --- i18n/zh.toml | 1 + layouts/_partials/term/term-fictions.html | 10 ++++++++++ layouts/term.html | 1 + 3 files changed, 12 insertions(+) create mode 100644 layouts/_partials/term/term-fictions.html diff --git a/i18n/zh.toml b/i18n/zh.toml index 193b5112..09cd26b9 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -40,6 +40,7 @@ cards = "所有卡片" [termPage] books = "我读过的相关书籍" weeklies = "提及此主题的周刊" +fictions = "我写过的关于这个主题的小说" [library] viewAllThisYear = "查看今年完整书单" diff --git a/layouts/_partials/term/term-fictions.html b/layouts/_partials/term/term-fictions.html new file mode 100644 index 00000000..3e3fd4a9 --- /dev/null +++ b/layouts/_partials/term/term-fictions.html @@ -0,0 +1,10 @@ +{{ $fictions := where .Pages "Section" "fiction" }} +{{ if gt (len $fictions) 0 }} +

{{ T "termPage.fictions" }}

+ +{{ end }} diff --git a/layouts/term.html b/layouts/term.html index b45a3b5c..130dea01 100644 --- a/layouts/term.html +++ b/layouts/term.html @@ -10,6 +10,7 @@ {{ end }} {{ partial "term/term-posts" . }} {{ partial "term/term-weeklies" . }} + {{ partial "term/term-fictions" . }} {{ partial "term/term-books" . }} -- cgit v1.2.3