summaryrefslogtreecommitdiff
path: root/layouts/library
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-08-23 22:28:20 +0800
committerEltrac <hi@guhub.cn>2025-08-23 22:28:20 +0800
commitd2c4f09f9052d7a6b8d973d481fb6fdab28994dd (patch)
treef3d6e2ffc171a4716e2ff009741cbc4b3a1d476c /layouts/library
parent8401c87051386e5cf0a28b7bba6c5be7ced10ce5 (diff)
feat: show book names as tooltips
Diffstat (limited to 'layouts/library')
-rw-r--r--layouts/library/section.html5
-rw-r--r--layouts/library/yearlist.html2
2 files changed, 4 insertions, 3 deletions
diff --git a/layouts/library/section.html b/layouts/library/section.html
index 9526c985..7ac5ef6c 100644
--- a/layouts/library/section.html
+++ b/layouts/library/section.html
@@ -7,7 +7,8 @@
{{ $books := first 18 (where .Site.RegularPages "Section" "library") }}
{{ range $i, $book := $books }}
{{ if eq .Date.Year now.Year }}
- <div class="{{ if gt $i 15 }}hidden md:block{{ end }}">
+ <div class="{{ if gt $i 15 }}hidden md:block{{ end }}"
+ data-tooltip="{{ $book.Title }}">
{{ partial "items/book" $book }}
</div>
{{ end }}
@@ -39,7 +40,7 @@
<h2>推荐好书</h2>
<div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
{{ range where (where .Site.RegularPages "Section" "library") ".Params.rating" "==" 5 }}
- {{ partial "items/book" . }}
+ <div data-tooltip="{{ .Title }}">{{ partial "items/book" . }}</div>
{{ end }}
</div>
</div>
diff --git a/layouts/library/yearlist.html b/layouts/library/yearlist.html
index ed62f014..8250046d 100644
--- a/layouts/library/yearlist.html
+++ b/layouts/library/yearlist.html
@@ -7,7 +7,7 @@
{{ $year := .Title }}
{{ range where .Site.RegularPages "Section" "library" }}
{{ if eq (printf "%d" .Date.Year) $year }}
- {{ partial "items/book" . }}
+ <div data-tooltip="{{ .Title }}">{{ partial "items/book" . }}</div>
{{ end }}
{{ end }}
</div>