Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add select maximum number of posts per page #866

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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*/}}
Expand Down
3 changes: 2 additions & 1 deletion layouts/categories/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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*/}}
Expand Down
3 changes: 2 additions & 1 deletion layouts/tags/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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*/}}
Expand Down
Loading