From 70bbb02bf56046c8c859783edd9f716cce5944ed Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 18 Aug 2025 10:20:08 +0800 Subject: fix: hide last two books in small screen to create balance --- layouts/library/section.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/layouts/library/section.html b/layouts/library/section.html index 1cb8874a..9526c985 100644 --- a/layouts/library/section.html +++ b/layouts/library/section.html @@ -4,11 +4,14 @@

{{ now.Year }} 年读的书

- {{ range first 18 (where .Site.RegularPages "Section" "library") }} - {{ if eq .Date.Year now.Year }} - {{ partial "items/book" . }} + {{ $books := first 18 (where .Site.RegularPages "Section" "library") }} + {{ range $i, $book := $books }} + {{ if eq .Date.Year now.Year }} +
+ {{ partial "items/book" $book }} +
+ {{ end }} {{ end }} - {{ end }}
{{ $years := slice }} -- cgit v1.2.3