diff options
author | James Elliott <james-d-elliott@users.noreply.github.com> | 2022-06-23 05:26:16 +0300 |
---|---|---|
committer | James Elliott <james-d-elliott@users.noreply.github.com> | 2022-06-23 05:26:16 +0300 |
commit | 21ba62dcc809138b4bc6185b46d5e924d8d46047 (patch) | |
tree | e6288ee83f620824f7bbfa7ec12701b93eebc00b /layouts | |
parent | cf51ea887dd12f79588f950988d0eb6c6895407f (diff) |
fix(menus): sort pages and sections by default order
This restores the default hugo sorting behaviour.
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/sidebar/auto-collapsible-menu.html | 4 | ||||
-rw-r--r-- | layouts/partials/sidebar/auto-default-menu.html | 2 |
2 files changed, 3 insertions, 3 deletions
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 }} <li class="mb-1"> <button class="btn btn-toggle align-items-center rounded collapsed" data-bs-toggle="collapse" data-bs-target="#section-{{ md5 .Title }}" aria-expanded="{{ if $active }}true{{ else }}false{{ end }}"> @@ -54,4 +54,4 @@ </li> {{ end }} {{ end }} -</ul>
\ No newline at end of file +</ul> 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 }} <h3 class="h6 text-uppercase mb-2">{{ .Title }}</h3> <ul class="list-unstyled"> |