diff options
| author | eltrac <hi@eltr.ac> | 2026-03-08 18:14:44 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-08 18:14:44 +0800 |
| commit | 302b179aa98c8693ce01bc77a56c3e92d0704af0 (patch) | |
| tree | e44e03f425b1a8b5f80a702d78fb3ba19f49e2cc | |
| parent | 965f10bb10959377c4bd412e385ee99750a6dc6d (diff) | |
feat: show fictions individually in term page
TODO need to refactor term.html, too many repeated code
| -rw-r--r-- | i18n/zh.toml | 1 | ||||
| -rw-r--r-- | layouts/_partials/term/term-fictions.html | 10 | ||||
| -rw-r--r-- | layouts/term.html | 1 |
3 files changed, 12 insertions, 0 deletions
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 }} +<h2>{{ T "termPage.fictions" }}</h2> +<ul id="term-fictions" + class="animate-duration-100 ps-0 flex flex-col gap-2 list-none leading-relaxed"> + {{ range $fictions }} + {{ partial "items/post-small" . }} + {{ end }} +</ul> +{{ 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" . }} </section> </article> |
