From efb3baca5a534e40555f379d6d3e6361b8e7cc8b Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sun, 27 Jul 2025 10:20:31 +0800 Subject: feat: less books in library section, display tags in book page --- i18n/en.yml | 2 ++ i18n/zh.yml | 2 ++ layouts/library/page.html | 12 +++++------- layouts/library/section.html | 13 +++++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/i18n/en.yml b/i18n/en.yml index 12ea2ed1..8831e018 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -25,3 +25,5 @@ termPage: books: "Books I've read about this topic" RSS: RSS statsTooltip: Insights +library: + viewAllThisYear: All Books This Year diff --git a/i18n/zh.yml b/i18n/zh.yml index 7d3fd5c5..b5decd54 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -26,3 +26,5 @@ termPage: books: '我读过的相关书籍' RSS: 订阅 statsTooltip: 洞察 +library: + viewAllThisYear: 查看今年完整书单 diff --git a/layouts/library/page.html b/layouts/library/page.html index 57007f04..e824077a 100644 --- a/layouts/library/page.html +++ b/layouts/library/page.html @@ -27,14 +27,12 @@

-
- {{ .Content }} -
- +
{{ .Content }}
{{ partial "posts/endnotes" . }} -
-

于 {{ partial "components/date" . }} 读完

-
+
+
+

于 {{ partial "components/date" . }} 读完

+

{{ partial "components/tags" . }}

{{ partial "posts/comment.html" . }} diff --git a/layouts/library/section.html b/layouts/library/section.html index 3910bcad..1cb8874a 100644 --- a/layouts/library/section.html +++ b/layouts/library/section.html @@ -4,7 +4,7 @@

{{ now.Year }} 年读的书

- {{ range where .Site.RegularPages "Section" "library" }} + {{ range first 18 (where .Site.RegularPages "Section" "library") }} {{ if eq .Date.Year now.Year }} {{ partial "items/book" . }} {{ end }} @@ -19,11 +19,16 @@ {{ end }} {{ end }} -
-

往年书单: + +

+ + {{ T "library.viewAllThisYear" }} + → + +

{{ $currentYear := printf "%d" now.Year }} {{ range $years }} - {{ if ne . $currentYear }}{{ . }} 年{{ end }} + {{ if ne . $currentYear }}{{ . }} 年{{ end }} {{ end }}

-- cgit v1.2.3