Skip to content

Commit

Permalink
Merge pull request #21663 from dvdksn/fix-sidebar-reverse
Browse files Browse the repository at this point in the history
hugo: fix 'reverse' option for re-ordering sidebar entries
  • Loading branch information
dvdksn authored Dec 18, 2024
2 parents 26c703d + e7246a2 commit 6a97d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Docker-Desktop",
"Docker-Hub",
"Docker-Scout-Dashboard",
"Docker-plan",
"Download",
"Entra-ID",
"Entra-ID-SAML-2.0",
Expand All @@ -68,6 +69,8 @@
"JavaScript",
"Jenkins",
"Latest",
"Legacy-Docker-plan",
"Legacy-Docker-plans",
"Linux",
"Local-or-Hub-storage",
"MDM",
Expand Down Expand Up @@ -138,7 +141,6 @@
"aspect-video",
"bake-action",
"bg-amber-light",
"bg-amber-light-200",
"bg-background-light",
"bg-black/50",
"bg-black/70",
Expand Down Expand Up @@ -191,7 +193,6 @@
"containerd-image-store",
"cursor-pointer",
"dark:bg-amber-dark",
"dark:bg-amber-dark-200",
"dark:bg-background-dark",
"dark:bg-blue-dark",
"dark:bg-blue-dark-400",
Expand Down Expand Up @@ -261,6 +262,7 @@
"flex-col",
"flex-col-reverse",
"flex-grow",
"flex-grow-0",
"flex-none",
"flex-shrink",
"flex-wrap",
Expand Down Expand Up @@ -342,6 +344,7 @@
"lg:gap-8",
"lg:grid-cols-2",
"lg:grid-cols-3",
"lg:grid-cols-4",
"lg:hidden",
"lg:no-underline",
"lg:pb-2",
Expand Down
3 changes: 1 addition & 2 deletions layouts/partials/sidebar/sections.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
</nav>

{{ define "renderChildren" }}
{{- $pages := .Pages }}
{{- $pages := where .Pages "Params.sitemap" "ne" "false" }}
{{- if .Params.sidebar.reverse }}
{{ $pages = .Pages.Reverse }}
{{- end }}
{{- $pages = where .Pages "Params.sitemap" "ne" "false" }}
{{- $ungrouped := where $pages "Params.sidebar.group" "==" nil }}
{{- range $ungrouped }}
{{- if .IsSection }}
Expand Down

0 comments on commit 6a97d65

Please sign in to comment.