From def5ce662e416eb097e86397a0a501a2d1a48c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:00:11 +0100 Subject: [PATCH] Add select maximum number of posts per page (#866) * Add select maximum number of posts per page * Rename ans simplify posts to show * Fix --- layouts/_default/list.html | 3 ++- layouts/categories/list.html | 3 ++- layouts/tags/list.html | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 6bc2de4..9485de3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -32,7 +32,8 @@
{{ $posts := where .RegularPagesRecursive "Layout" "!=" "search" }} - {{ $paginator := .Paginate $posts 12 }} + {{ $numShow := site.Params.features.pagination.maxPostsPerPage | default 12}} + {{ $paginator := .Paginate $posts $numShow }} {{ range $paginator.Pages }} {{ if .Layout }} {{/* ignore the search.md file*/}} diff --git a/layouts/categories/list.html b/layouts/categories/list.html index 48a48a4..5a79b8f 100644 --- a/layouts/categories/list.html +++ b/layouts/categories/list.html @@ -33,7 +33,8 @@
{{ $posts := where .RegularPagesRecursive "Layout" "!=" "search" }} - {{ $paginator := .Paginate $posts 12 }} + {{ $numShow := site.Params.features.pagination.maxPostsPerPage | default 12}} + {{ $paginator := .Paginate $posts $numShow }} {{ range $paginator.Pages }} {{ if .Layout }} {{/* ignore the search.md file*/}} diff --git a/layouts/tags/list.html b/layouts/tags/list.html index 4ff7fd7..514a141 100644 --- a/layouts/tags/list.html +++ b/layouts/tags/list.html @@ -33,7 +33,8 @@
{{ $posts := where .RegularPagesRecursive "Layout" "!=" "search" }} - {{ $paginator := .Paginate $posts 12 }} + {{ $numShow := site.Params.features.pagination.maxPostsPerPage | default 12}} + {{ $paginator := .Paginate $posts $numShow }} {{ range $paginator.Pages }} {{ if .Layout }} {{/* ignore the search.md file*/}}