summaryrefslogtreecommitdiff
path: root/layouts/library
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-08-25 21:50:44 +0800
committerEltrac <hi@guhub.cn>2025-08-25 21:50:44 +0800
commitfb2d4daf5ade1df6d11977adb9c3ba13d5ff3969 (patch)
tree537d044a7304f02de29ead40d98b77993b02fced /layouts/library
parent944e2a397873417f855e1b03499b8aba072c330a (diff)
feat: show books of the same author
Former-commit-id: f343c4533fd9b4563d0c892faf56b7c85fb5d9cb
Diffstat (limited to 'layouts/library')
-rw-r--r--layouts/library/page.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/library/page.html b/layouts/library/page.html
index f5a9df5b..28983cc2 100644
--- a/layouts/library/page.html
+++ b/layouts/library/page.html
@@ -26,16 +26,32 @@
{{- end -}}
</p>
</header>
+
<div class="markdown-body">
<div class="leading-loose">{{ .Content }}</div>
{{ partial "posts/endnotes" . }}
</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 "components/backlinks" (dict "filename" .File.BaseFileName "type" "library" "context" .) }}
{{ partial "posts/action-menu.html" . }}
{{ partial "components/back-to-top.html" . }}
+
+ {{ $books := where (where .Site.RegularPages "Section" "library") ".Params.author" "==" .Params.author }}
+ {{ $thisBookID := .File.UniqueID }}
+ {{ if $books }}
+ <h2>我读过的{{ .Params.author }}的其它书籍</h2>
+ <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
+ {{ range $books }}
+ {{ if ne .File.UniqueID $thisBookID }}
+ <div data-tooltip="{{ .Title }}">{{ partial "items/book" . }}</div>
+ {{ end }}
+ {{ end }}
+ </div>
+ {{ end }}
</article>
{{ end }}