summaryrefslogtreecommitdiff
path: root/layouts/library/section.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-27 10:20:31 +0800
committerEltrac <hi@guhub.cn>2025-07-27 10:20:31 +0800
commitefb3baca5a534e40555f379d6d3e6361b8e7cc8b (patch)
treedfca3a7bcfb0c7c043183b4b188c205dd8be56c9 /layouts/library/section.html
parent22b53553b8789d7f6ccf94cc087ae8d3e82c11ac (diff)
feat: less books in library section, display tags in book page
Diffstat (limited to 'layouts/library/section.html')
-rw-r--r--layouts/library/section.html13
1 files changed, 9 insertions, 4 deletions
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>