From 21ba62dcc809138b4bc6185b46d5e924d8d46047 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Thu, 23 Jun 2022 12:26:16 +1000 Subject: [PATCH] fix(menus): sort pages and sections by default order This restores the default hugo sorting behaviour. --- content/en/docs/help/_index.md | 1 + content/en/docs/prologue/_index.md | 1 + layouts/partials/sidebar/auto-collapsible-menu.html | 4 ++-- layouts/partials/sidebar/auto-default-menu.html | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/content/en/docs/help/_index.md b/content/en/docs/help/_index.md index bc503ec..b5763a3 100644 --- a/content/en/docs/help/_index.md +++ b/content/en/docs/help/_index.md @@ -6,4 +6,5 @@ date: 2020-10-06T08:49:15+00:00 lastmod: 2020-10-06T08:49:15+00:00 draft: false images: [] +weight: 600 --- diff --git a/content/en/docs/prologue/_index.md b/content/en/docs/prologue/_index.md index c3c1c40..d6b467c 100644 --- a/content/en/docs/prologue/_index.md +++ b/content/en/docs/prologue/_index.md @@ -6,4 +6,5 @@ date: 2020-10-06T08:48:45+00:00 lastmod: 2020-10-06T08:48:45+00:00 draft: false images: [] +weight: 100 --- diff --git a/layouts/partials/sidebar/auto-collapsible-menu.html b/layouts/partials/sidebar/auto-collapsible-menu.html index 3eaa2f6..4600d0a 100644 --- a/layouts/partials/sidebar/auto-collapsible-menu.html +++ b/layouts/partials/sidebar/auto-collapsible-menu.html @@ -3,7 +3,7 @@ {{ $currentPage := . -}} {{ $section := $currentPage.Section -}} {{ range (where .Site.Sections "Section" "in" $section) }} - {{ range .Sections.ByWeight.Reverse }} + {{ range .Sections }} {{ $active := in $currentPage.RelPermalink .RelPermalink }}
  • {{ end }} {{ end }} - \ No newline at end of file + diff --git a/layouts/partials/sidebar/auto-default-menu.html b/layouts/partials/sidebar/auto-default-menu.html index b46bb5a..6e4565b 100644 --- a/layouts/partials/sidebar/auto-default-menu.html +++ b/layouts/partials/sidebar/auto-default-menu.html @@ -2,7 +2,7 @@ {{ $currentPage := . -}} {{ $section := $currentPage.Section -}} {{ range (where .Site.Sections "Section" "in" $section) }} - {{ range .Sections.ByWeight.Reverse }} + {{ range .Sections }} {{ $active := in $currentPage.RelPermalink .RelPermalink }}

    {{ .Title }}