This commit is contained in:
Francesco 2024-05-21 19:16:01 +02:00
parent 27e4286af3
commit 8fe6a2c12a
3 changed files with 48 additions and 38 deletions

View file

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

View file

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

View file

@ -1,29 +1,32 @@
{{ define "main" }}
{{ partial "breadcrumbs.html" . }}
<div class="list-container">
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ partial "breadcrumbs.html" . }}
{{ $tagsPage := eq .Title "Tags"}}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ $paginationSize := 1}}
{{ if (gt .Site.Params.paginationSize 0) }}
{{ $paginationSize = .Site.Params.paginationSize }}
{{ $tagsPage := eq .Title "Tags"}}
{{ $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 }}
{{ $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 }}