From b531d3fd3626a9e85d6142fbfc3a69c6904021b4 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Wed, 5 Feb 2025 16:50:33 -0800 Subject: [PATCH] Use default page order --- layouts/partials/paige/list.html | 16 +++++----------- layouts/partials/paige/order.html | 23 ----------------------- 2 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 layouts/partials/paige/order.html diff --git a/layouts/partials/paige/list.html b/layouts/partials/paige/list.html index 497a04cd..2a91d855 100644 --- a/layouts/partials/paige/list.html +++ b/layouts/partials/paige/list.html @@ -58,19 +58,17 @@ {{ end }} {{ with $collections }} - {{ $ordered := partial "paige/order.html" (dict "pages" .) }} -
{{ if or $sections $pages }}

{{ i18n "paige_collections" }}

{{ end }} {{ if or $sections $pages }} - {{ range $ordered }} + {{ range . }} {{ partial "paige/list-item.html" . }} {{ end }} {{ else }} - {{ $pager := $page.Paginate $ordered }} + {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} @@ -82,19 +80,17 @@ {{ end }} {{ with $sections }} - {{ $ordered := partial "paige/order.html" (dict "pages" .) }} -
{{ if or $collections $pages }}

{{ i18n "paige_sections" }}

{{ end }} {{ if $pages }} - {{ range $ordered }} + {{ range . }} {{ partial "paige/list-item.html" . }} {{ end }} {{ else }} - {{ $pager := $page.Paginate $ordered }} + {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} @@ -106,14 +102,12 @@ {{ end }} {{ with $pages }} - {{ $ordered := partial "paige/order.html" (dict "pages" .) }} -
{{ if or $collections $sections }}

{{ i18n "paige_pages" }}

{{ end }} - {{ $pager := $page.Paginate $ordered }} + {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} diff --git a/layouts/partials/paige/order.html b/layouts/partials/paige/order.html deleted file mode 100644 index 94f020e5..00000000 --- a/layouts/partials/paige/order.html +++ /dev/null @@ -1,23 +0,0 @@ -{{ $params := . }} - -{{ $pages := $params.pages }} - -{{ $result := slice }} -{{ $weights := $pages.GroupBy "Weight" }} - -{{ range $i, $e := $weights }} - {{ if eq $e.Key 0 }} - {{ $weights = slice | append (first $i $weights) | append (after (add $i 1) $weights) | append $e }} - {{ break }} - {{ end }} -{{ end }} - -{{ range $weights }} - {{ range (sort (.Pages.GroupBy "PublishDate") "Key").Reverse }} - {{ range .Pages.ByTitle }} - {{ $result = $result | append . }} - {{ end }} - {{ end }} -{{ end }} - -{{ return $result }}