From 806f0cafe006ece20554736a291cf8a79e7c62bf Mon Sep 17 00:00:00 2001 From: Will Faught Date: Wed, 14 Dec 2022 00:46:33 -0800 Subject: [PATCH] Add paigeshowfullpages page parameter --- README.md | 3 +++ layouts/partials/paige-pages.html | 42 ++++++++++++++++++++----------- layouts/partials/paige-title.html | 2 +- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5a36f4ef..e1eb6b3f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/layouts/partials/paige-pages.html b/layouts/partials/paige-pages.html index 011150b9..b76b956b 100644 --- a/layouts/partials/paige-pages.html +++ b/layouts/partials/paige-pages.html @@ -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 }}
- {{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }} - {{ range $p.PageGroups }} -
{{ .Key }}
- {{ range .Pages }} -

- {{ .Title | markdownify }} - {{ with .Description }} -
- {{ . | markdownify }} - {{ end }} -

- {{ end }} - {{ end }} - {{ if or $p.HasPrev $p.HasNext }}
{{ partial "paige-pagination.html" . }}
+
+{{ end }} +{{ else }} +{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }} +{{ range $p.PageGroups }} +
{{ .Key }}
+{{ range .Pages }} +

+ {{ .Title | markdownify }} + {{ with .Description }} +
+ {{ . | markdownify }} {{ end }} +

+{{ end }} +{{ end }} +{{ if or $p.HasPrev $p.HasNext }} +
+
+ {{ partial "paige-pagination.html" . }} +
{{ end }} +{{ end }} +{{ end }} diff --git a/layouts/partials/paige-title.html b/layouts/partials/paige-title.html index f42ad60d..96cfd1eb 100644 --- a/layouts/partials/paige-title.html +++ b/layouts/partials/paige-title.html @@ -6,7 +6,7 @@ {{ $title = .Site.Title }} {{ end }} {{ end }} -{{ if $title }} +{{ if and $title (not .Params.paigeshowfullpages) }}

{{ with .Params.link }} {{ $title | markdownify }}