This commit is contained in:
Francesco 2024-05-21 19:16:01 +02:00
parent 5556e85ead
commit d8f9e8cf1e
3 changed files with 48 additions and 38 deletions

View File

@ -201,11 +201,15 @@ footer a {
color: var(--content-secondary); color: var(--content-secondary);
} }
.list-container {
padding-bottom: 1rem;
}
.pagination { .pagination {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 1rem; margin-top: 1rem;
margin-bottom: 1rem; margin-bottom: 0rem;
justify-content: center; justify-content: center;
} }

View File

@ -34,25 +34,28 @@
{{ if .Site.Params.homeCollection }} {{ if .Site.Params.homeCollection }}
{{ with .Site.Params.homeCollectionTitle}} <div class="list-container">
<h1> {{ . }} </h1> {{ with .Site.Params.homeCollectionTitle}}
{{ end }} <h1> {{ . }} </h1>
{{ end }}
{{ $pages := where .Site.RegularPages "Section" .Site.Params.homeCollection }} {{ $pages := where .Site.RegularPages "Section" .Site.Params.homeCollection
}}
{{ $paginationSize := 1}} {{ $paginationSize := 1}}
{{ if (gt .Site.Params.paginationSize 0) }} {{ if (gt .Site.Params.paginationSize 0) }}
{{ $paginationSize = .Site.Params.paginationSize }} {{ $paginationSize = .Site.Params.paginationSize }}
{{ end }} {{ end }}
{{ $paginator := .Paginate $pages $paginationSize }} {{ $paginator := .Paginate $pages $paginationSize }}
{{ range $index, $page := $paginator.Pages }} {{ range $index, $page := $paginator.Pages }}
{{ partial "post-entry.html" $page}} {{ partial "post-entry.html" $page}}
{{ end }} {{ end }}
{{ partial "pagination-controls.html" $paginator}} {{ partial "pagination-controls.html" $paginator}}
{{ end }} {{ end }}
</div>
{{ end }} {{ end }}

View File

@ -1,29 +1,32 @@
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumbs.html" . }} <div class="list-container">
<h1>{{ .Title }}</h1> {{ partial "breadcrumbs.html" . }}
{{ .Content }}
{{ $tagsPage := eq .Title "Tags"}} <h1>{{ .Title }}</h1>
{{ .Content }}
{{ $paginationSize := 1}} {{ $tagsPage := eq .Title "Tags"}}
{{ if (gt .Site.Params.paginationSize 0) }}
{{ $paginationSize = .Site.Params.paginationSize }} {{ $paginationSize := 1}}
{{ if (gt .Site.Params.paginationSize 0) }}
{{ $paginationSize = .Site.Params.paginationSize }}
{{ end }}
{{ $paginator := .Paginate (.Pages) $paginationSize }}
{{ range $index, $page := $paginator.Pages }}
{{ if $tagsPage }}
{{ partial "tag-entry.html" $page}}
{{ else }}
{{ partial "post-entry.html" $page}}
{{ end }}
{{ end }}
{{ partial "pagination-controls.html" $paginator}}
</div>
{{ end }} {{ end }}
{{ $paginator := .Paginate (.Pages) $paginationSize }}
{{ range $index, $page := $paginator.Pages }}
{{ if $tagsPage }}
{{ partial "tag-entry.html" $page}}
{{ else }}
{{ partial "post-entry.html" $page}}
{{ end }}
{{ end }}
{{ partial "pagination-controls.html" $paginator}}
{{ end }}