diff options
| -rw-r--r-- | i18n/en.yml | 2 | ||||
| -rw-r--r-- | i18n/zh.yml | 2 | ||||
| -rw-r--r-- | layouts/library/page.html | 12 | ||||
| -rw-r--r-- | 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 @@ </p> </header> <div class="markdown-body"> - <div class="leading-loose"> - {{ .Content }} - </div> - <!-- Endnotes --> + <div class="leading-loose">{{ .Content }}</div> {{ partial "posts/endnotes" . }} - <div class="text-size-base text-secondary"> - <p>于 {{ partial "components/date" . }} 读完</p> - </div> + </div> + <div class="text-size-base text-secondary md:flex md:justify-between"> + <p>于 {{ partial "components/date" . }} 读完</p> + <p>{{ partial "components/tags" . }}</p> </div> {{ partial "posts/comment.html" . }} </article> 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 @@ <div> <h2>{{ now.Year }} 年读的书</h2> <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4"> - {{ 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 }} - <div class="markdown-body"> - <p>往年书单: + + <div class="flex items-center my-8"> + <a href="/library/2025" class="small-button"> + {{ T "library.viewAllThisYear" }} + <span class="text-secondary">→</span> + </a> + <p class="my-0 mx-4"> {{ $currentYear := printf "%d" now.Year }} {{ range $years }} - {{ if ne . $currentYear }}<a href="{{ printf "/library/%s/" . }}">{{ . }} 年</a>{{ end }} + {{ if ne . $currentYear }}<a class="text-secondary" href="{{ printf "/library/%s/" . }}">{{ . }} 年</a>{{ end }} {{ end }} </p> </div> |
