From 7d54db7d303dffa62005c96668d7ed2dffd52ffd Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 9 Feb 2025 22:08:59 -0800 Subject: [PATCH] Fix sections not showing in term pages --- layouts/partials/paige/list.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/layouts/partials/paige/list.html b/layouts/partials/paige/list.html index e08e7159..819f0b86 100644 --- a/layouts/partials/paige/list.html +++ b/layouts/partials/paige/list.html @@ -40,8 +40,8 @@ {{ end }} {{ $collections := slice }} -{{ $pages := $page.RegularPages | and ($page.Param "paige.pages.disable_pages" | not) }} -{{ $sections := $page.Sections | and ($page.Param "paige.pages.disable_sections" | not) }} +{{ $pages := slice }} +{{ $sections := slice }} {{ if $page.IsHome }} {{ range $name, $taxonomy := site.Taxonomies }} @@ -54,11 +54,19 @@ {{ $collections = $collections | and ($page.Param "paige.pages.disable_collections" | not) }} {{ if in (slice "taxonomy" "term") $page.Kind }} - {{ if not $pages }} - {{ $pages = $page.Pages }} + {{ range $page.Pages }} + {{ if .IsSection }} + {{ $pages = $pages | append . }} + {{ else }} + {{ $sections = $sections | append . }} + {{ end }} {{ end }} - {{ $pages = sort $pages "LinkTitle" }} + {{ $pages = sort $pages "LinkTitle" | and ($page.Param "paige.pages.disable_pages" | not) }} + {{ $sections = sort $sections "LinkTitle" | and ($page.Param "paige.pages.disable_sections" | not) }} +{{ else }} + {{ $pages = $page.Pages | and ($page.Param "paige.pages.disable_pages" | not) }} + {{ $sections = $page.Sections | and ($page.Param "paige.pages.disable_sections" | not) }} {{ end }} {{ with $collections }}