Merge pull request #191 from Mitrichius/add-pagination-to-short-list-with-full-content

Add pagination to short list with full content
This commit is contained in:
Dmitry Kolosov 2023-07-20 20:04:07 +03:00 committed by GitHub
commit 7f95692d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,13 @@
<h1 class="post-title">{{ i18n .Title }}</h1> <h1 class="post-title">{{ i18n .Title }}</h1>
{{ $showFullContent := in .Site.Params.sectionsWithFullContentOnListPage .Section }} {{ $showFullContent := in .Site.Params.sectionsWithFullContentOnListPage .Section }}
{{ $pages := where .Pages "Params.hidden" "!=" true}} {{ $pages := where .Pages "Params.hidden" "!=" true}}
{{ range $pages }}
{{ $pagesRange := $pages}}
{{ if $showFullContent }}
{{ $pagesRange = (.Paginate $pages).Pages }}
{{ end}}
{{ range $pagesRange }}
<div class="post-short-list h-entry"> <div class="post-short-list h-entry">
<div class="post-header"> <div class="post-header">
<header> <header>
@ -21,6 +27,9 @@
{{ partial "post-info.html" . }} {{ partial "post-info.html" . }}
</div> </div>
{{ end }} {{ end }}
{{ if $showFullContent }}
{{ partial "pagination.html" . }}
{{ end}}
</div> </div>
{{ end }} {{ end }}