diff --git a/layouts/partials/paige/pages.html b/layouts/partials/paige/pages.html index 3f648314..b53c8d4d 100644 --- a/layouts/partials/paige/pages.html +++ b/layouts/partials/paige/pages.html @@ -1,7 +1,11 @@ {{ $page := . }} {{ $collections := slice }} +{{ $h2size := "h4" }} +{{ $manypagegroups := false }} {{ $sections := where $page.Pages "Kind" "section" }} +{{ $pagegroups := slice }} +{{ $pager := false }} {{ $pages := where $page.Pages "Kind" "in" (slice "page" "term") }} {{ range $name, $taxonomy := cond $page.IsHome site.Taxonomies slice }} @@ -10,10 +14,29 @@ {{ end }} {{ end }} +{{ $pinned := where $pages "Params.paige.pin" true }} + +{{ $unpinned := complement $pinned $pages }} + +{{ $weighted := where $unpinned "Weight" "gt" 0 }} + +{{ if $weighted }} + {{ $h2size = "h5" }} + {{ $pager = $page.Paginate $unpinned.ByWeight }} +{{ else }} + {{ $pager = $page.Paginate ($unpinned.GroupByPublishDate "January 2006") }} + {{ $pagegroups = $pager.PageGroups }} + {{ $manypagegroups = gt (len $pagegroups) 1 }} + + {{ if not $manypagegroups }} + {{ $h2size = "h5" }} + {{ end }} +{{ end }} + {{ with $collections }}