From d94f895296276385313b14ebb230a77124918b18 Mon Sep 17 00:00:00 2001 From: Reorx Date: Thu, 14 Apr 2022 15:06:17 +0800 Subject: [PATCH] allow customizing pagination by adding "paginate" in frontmatter --- layouts/_default/list.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index df22aac..6a8b3c9 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -30,7 +30,13 @@ {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} {{- end }} -{{- $paginator := .Paginate $pages }} +{{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}} +{{ $paginator := "" }} +{{ if (.Param "paginate") }} + {{- $paginator = .Paginate $pages (.Param "paginate") }} +{{ else }} + {{- $paginator = .Paginate $pages }} +{{ end }} {{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} {{- partial "home_info.html" . }}