Add select maximum number of posts per page (#866)

* Add select maximum number of posts per page

* Rename ans simplify posts to show

* Fix
This commit is contained in:
Bernat Borràs Civil 2024-01-19 20:00:11 +01:00 committed by GitHub
parent 1aa27921d0
commit def5ce662e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -32,7 +32,8 @@
<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 := site.Params.features.pagination.maxPostsPerPage | default 12}}
{{ $paginator := .Paginate $posts $numShow }}
{{ range $paginator.Pages }}
{{ if .Layout }}
{{/* ignore the search.md file*/}}

View file

@ -33,7 +33,8 @@
<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 := site.Params.features.pagination.maxPostsPerPage | default 12}}
{{ $paginator := .Paginate $posts $numShow }}
{{ range $paginator.Pages }}
{{ if .Layout }}
{{/* ignore the search.md file*/}}

View file

@ -33,7 +33,8 @@
<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 := site.Params.features.pagination.maxPostsPerPage | default 12}}
{{ $paginator := .Paginate $posts $numShow }}
{{ range $paginator.Pages }}
{{ if .Layout }}
{{/* ignore the search.md file*/}}