Add paigeshowfullpages page parameter

master
Will Faught 3 years ago
parent 4fec568d74
commit 806f0cafe0

@ -83,6 +83,9 @@ the page `content/_index.md`.
The section menu uses the `main` identifier.
To show full pages instead of just the page title and description in a
list page, set the list page parameter `paigeshowfullpages` to true.
The page date is the publish date, if any; otherwise, it's the creation
date. To change the date format displayed, set the site parameter
`paigedateformat` to a Hugo date format.

@ -1,22 +1,36 @@
{{ if .Pages }}
{{ if .Params.paigeshowfullpages }}
{{ $p := .Paginate .Pages }}
{{ range $p.Pages }}
{{ partial "paige-main.html" . }}
{{ end }}
{{ if or $p.HasPrev $p.HasNext }}
<section>
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
{{ range $p.PageGroups }}
<h5 class="text-center">{{ .Key }}</h5>
{{ range .Pages }}
<p class="text-center">
<div class="d-flex justify-content-center">
{{ partial "paige-pagination.html" . }}
</div>
</section>
{{ end }}
{{ else }}
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
{{ range $p.PageGroups }}
<h5 class="text-center">{{ .Key }}</h5>
{{ range .Pages }}
<p class="text-center">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
{{ with .Description }}
<br>
{{ . | markdownify }}
{{ end }}
</p>
{{ end }}
{{ end }}
{{ if or $p.HasPrev $p.HasNext }}
</p>
{{ end }}
{{ end }}
{{ if or $p.HasPrev $p.HasNext }}
<section>
<div class="d-flex justify-content-center">
{{ partial "paige-pagination.html" . }}
</div>
{{ end }}
</section>
{{ end }}
{{ end }}
{{ end }}

@ -6,7 +6,7 @@
{{ $title = .Site.Title }}
{{ end }}
{{ end }}
{{ if $title }}
{{ if and $title (not .Params.paigeshowfullpages) }}
<h1 class="{{ $class }} fw-bold text-center">
{{ with .Params.link }}
<a href="{{ . }}">{{ $title | markdownify }}</a>

Loading…
Cancel
Save