summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-08-25 21:58:39 +0800
committerEltrac <hi@guhub.cn>2025-08-25 21:58:39 +0800
commit52345965347199d43452168fd4462e06e0dbdaf1 (patch)
treeb7c2496dd64bebc379daecc82e5b548b570e1843
parent2d184fbeef2ba03114e4d1a0feca1e31875bd321 (diff)
fix: same-author book section showing even when there's no other books
Former-commit-id: 595e7d5af86ddc1f581ed60d89dc33a27cfd8983
-rw-r--r--layouts/library/page.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/library/page.html b/layouts/library/page.html
index 28983cc2..e8760b60 100644
--- a/layouts/library/page.html
+++ b/layouts/library/page.html
@@ -43,7 +43,7 @@
{{ $books := where (where .Site.RegularPages "Section" "library") ".Params.author" "==" .Params.author }}
{{ $thisBookID := .File.UniqueID }}
- {{ if $books }}
+ {{ if gt (count $books) 1 }}
<h2>我读过的{{ .Params.author }}的其它书籍</h2>
<div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
{{ range $books }}