From fb2d4daf5ade1df6d11977adb9c3ba13d5ff3969 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 25 Aug 2025 21:50:44 +0800 Subject: feat: show books of the same author Former-commit-id: f343c4533fd9b4563d0c892faf56b7c85fb5d9cb --- layouts/library/page.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -}}

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

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

{{ partial "components/tags" . }}

+ {{ 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 }} +

我读过的{{ .Params.author }}的其它书籍

+
+ {{ range $books }} + {{ if ne .File.UniqueID $thisBookID }} +
{{ partial "items/book" . }}
+ {{ end }} + {{ end }} +
+ {{ end }} {{ end }} -- cgit v1.2.3