News and author pages: listPosts per page, with pager

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
2026-10-11 20:56:58 +02:00
co-authored by Claude Opus 5.5
parent aa54440c7c
commit 63ab6f3071
6 changed files with 27 additions and 4 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<div class="content">{{ .Content }}</div>
{{ $pager := .Paginate .RegularPages.ByDate.Reverse (site.Params.listPosts | default 20) }}
<div class="posts">
{{ range .RegularPages.ByDate.Reverse }}{{ partial "post-summary.html" . }}{{ end }}
{{ range $pager.Pages }}{{ partial "post-summary.html" . }}{{ end }}
</div>
{{ partial "pager.html" $pager }}
{{ end }}