From 8983b2a48d16bc763f5181bb974ee73efbcaafff Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 6 Nov 2025 11:01:00 +0800 Subject: fix: duplicated view transition names in library page --- layouts/_partials/items/book.html | 15 +++++++++------ layouts/_partials/term/term-books.html | 2 +- layouts/library/page.html | 4 +++- layouts/library/section.html | 11 +++++++++-- layouts/library/yearlist.html | 3 ++- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/layouts/_partials/items/book.html b/layouts/_partials/items/book.html index dca2961b..5a8c8efd 100644 --- a/layouts/_partials/items/book.html +++ b/layouts/_partials/items/book.html @@ -1,14 +1,17 @@ +{{ $ctx := .ctx }} +{{ $NoViewTransition := (or .NoViewTransition false) }} - + - - {{ if eq .Params.rating 1 }} + + {{ if eq $ctx.Params.rating 1 }}
{{ range $books }} - {{ partial "items/book" . }} + {{ partial "items/book" (dict "ctx" .) }} {{ end }}
{{ end }} diff --git a/layouts/library/page.html b/layouts/library/page.html index bcd36854..df2192de 100644 --- a/layouts/library/page.html +++ b/layouts/library/page.html @@ -49,7 +49,9 @@
{{ range $books }} {{ if ne .File.UniqueID $thisBookID }} -
{{ partial "items/book" . }}
+
+ {{ partial "items/book" (dict "ctx" .) }} +
{{ end }} {{ end }}
diff --git a/layouts/library/section.html b/layouts/library/section.html index 973c6351..a7df419a 100644 --- a/layouts/library/section.html +++ b/layouts/library/section.html @@ -14,7 +14,9 @@ {{ range $i, $book := $first18BooksThisYear }}
- {{ partial "items/book" $book }} + {{ partial "items/book" (dict + "ctx" $book + ) }}
{{ end }}
@@ -47,7 +49,12 @@ )}}
{{ range $goodBooks }} -
{{ partial "items/book" . }}
+
+ {{ partial "items/book" (dict + "ctx" . + "NoViewTransition" true + ) }} +
{{ end }}
diff --git a/layouts/library/yearlist.html b/layouts/library/yearlist.html index 8250046d..1405cb27 100644 --- a/layouts/library/yearlist.html +++ b/layouts/library/yearlist.html @@ -7,7 +7,8 @@ {{ $year := .Title }} {{ range where .Site.RegularPages "Section" "library" }} {{ if eq (printf "%d" .Date.Year) $year }} -
{{ partial "items/book" . }}
+
+ {{ partial "items/book" (dict "ctx" .) }}
{{ end }} {{ end }} -- cgit v1.2.3