From 39cffeb0bcd7e9aff35a38951b2154852e5968d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 18 May 2026 18:33:21 +0200 Subject: [PATCH] Add pagination to category, tag, and issue pages (10 per page) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pagerSize set to 10 (5 columns × 2 rows). New pagination partial renders prev/next links and numbered page buttons. Applied to _default/list.html (categories + tags) and issues/list.html. Co-Authored-By: Claude Sonnet 4.6 --- hugo.toml | 2 +- layouts/_default/list.html | 4 ++- layouts/issues/list.html | 4 ++- layouts/partials/pagination.html | 59 ++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 layouts/partials/pagination.html diff --git a/hugo.toml b/hugo.toml index 353ba4b..d5f2445 100644 --- a/hugo.toml +++ b/hugo.toml @@ -4,7 +4,7 @@ title = "Roux" enableRobotsTXT = true enableGitInfo = false [pagination] -pagerSize = 200 +pagerSize = 10 [taxonomies] category = "categories" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f6aabf6..de4a300 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -24,12 +24,14 @@ {{- end }} +{{- $paginator := .Paginate .Pages }}
- {{- range $i, $p := .Pages }} + {{- range $i, $p := $paginator.Pages }} {{- partial "card.html" (dict "Page" $p "Index" $i) }} {{- end }}
+{{- partial "pagination.html" $paginator }} {{ end }} diff --git a/layouts/issues/list.html b/layouts/issues/list.html index 4af756d..1484a96 100644 --- a/layouts/issues/list.html +++ b/layouts/issues/list.html @@ -9,10 +9,12 @@

{{ .Params.description }}

+{{- $paginator := .Paginate .Pages }}
- {{- range $i, $p := .Pages }} + {{- range $i, $p := $paginator.Pages }} {{- partial "card.html" (dict "Page" $p "Index" $i) }} {{- end }}
+{{- partial "pagination.html" $paginator }} {{ end }} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..64add6a --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,59 @@ +{{- $p := . }} +{{- if gt $p.TotalPages 1 }} + +{{- end }}