From 6231218bf2d1d9c2c5596c1c3389b12ad7ba61af Mon Sep 17 00:00:00 2001 From: Will Faught Date: Tue, 28 May 2024 00:48:51 -0700 Subject: [PATCH] Hide page group header if only one --- layouts/partials/paige/pages.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/layouts/partials/paige/pages.html b/layouts/partials/paige/pages.html index fb21f4a5..06e2c516 100644 --- a/layouts/partials/paige/pages.html +++ b/layouts/partials/paige/pages.html @@ -48,11 +48,14 @@ {{ end }} {{ $unpinned := complement $pinned . }} - {{ $pagegroups := $unpinned.GroupByPublishDate "January 2006" }} - {{ $pager := $page.Paginate $pagegroups }} + {{ $pagecollection := $unpinned.GroupByPublishDate "January 2006" }} + {{ $pager := $page.Paginate $pagecollection }} + {{ $pagegroups := $pager.PageGroups}} - {{ range $pager.PageGroups }} -

{{ .Key }}

+ {{ range $pagegroups }} + {{ if gt (len $pagegroups) 1 }} +

{{ .Key }}

+ {{ end }} {{ range .Pages.ByWeight }} {{ partial "paige/page.html" . }}