summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/library/section.html11
1 files 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 @@
<div>
<h2>{{ now.Year }} 年读的书</h2>
<div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
- {{ 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 }}
+ <div class="{{ if gt $i 15 }}hidden md:block{{ end }}">
+ {{ partial "items/book" $book }}
+ </div>
+ {{ end }}
{{ end }}
- {{ end }}
</div>
{{ $years := slice }}