Add select maximum number of posts per page

This commit is contained in:
BernatBC 2024-01-19 10:12:58 +01:00
parent 1aa27921d0
commit 97721a3c49
3 changed files with 15 additions and 3 deletions

View file

@ -32,7 +32,11 @@
<div class="content container-fluid" id="content">
<div class="container-fluid post-card-holder" id="post-card-holder">
{{ $posts := where .RegularPagesRecursive "Layout" "!=" "search" }}
{{ $paginator := .Paginate $posts 12 }}
{{ $numShow := 12}}
{{ if site.Params.postsPage.maxPostsPerPage}}
{{ $numShow = site.Params.postsPage.maxPostsPerPage }}
{{ end }}
{{ $paginator := .Paginate $posts $numShow }}
{{ range $paginator.Pages }}
{{ if .Layout }}
{{/* ignore the search.md file*/}}