hugo: fix 'reverse' option for re-ordering sidebar entries

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-12-18 13:06:50 +01:00
parent 26c703d67f
commit e7246a2fdf
2 changed files with 6 additions and 4 deletions

View File

@ -42,6 +42,7 @@
"Docker-Desktop", "Docker-Desktop",
"Docker-Hub", "Docker-Hub",
"Docker-Scout-Dashboard", "Docker-Scout-Dashboard",
"Docker-plan",
"Download", "Download",
"Entra-ID", "Entra-ID",
"Entra-ID-SAML-2.0", "Entra-ID-SAML-2.0",
@ -68,6 +69,8 @@
"JavaScript", "JavaScript",
"Jenkins", "Jenkins",
"Latest", "Latest",
"Legacy-Docker-plan",
"Legacy-Docker-plans",
"Linux", "Linux",
"Local-or-Hub-storage", "Local-or-Hub-storage",
"MDM", "MDM",
@ -138,7 +141,6 @@
"aspect-video", "aspect-video",
"bake-action", "bake-action",
"bg-amber-light", "bg-amber-light",
"bg-amber-light-200",
"bg-background-light", "bg-background-light",
"bg-black/50", "bg-black/50",
"bg-black/70", "bg-black/70",
@ -191,7 +193,6 @@
"containerd-image-store", "containerd-image-store",
"cursor-pointer", "cursor-pointer",
"dark:bg-amber-dark", "dark:bg-amber-dark",
"dark:bg-amber-dark-200",
"dark:bg-background-dark", "dark:bg-background-dark",
"dark:bg-blue-dark", "dark:bg-blue-dark",
"dark:bg-blue-dark-400", "dark:bg-blue-dark-400",
@ -261,6 +262,7 @@
"flex-col", "flex-col",
"flex-col-reverse", "flex-col-reverse",
"flex-grow", "flex-grow",
"flex-grow-0",
"flex-none", "flex-none",
"flex-shrink", "flex-shrink",
"flex-wrap", "flex-wrap",
@ -342,6 +344,7 @@
"lg:gap-8", "lg:gap-8",
"lg:grid-cols-2", "lg:grid-cols-2",
"lg:grid-cols-3", "lg:grid-cols-3",
"lg:grid-cols-4",
"lg:hidden", "lg:hidden",
"lg:no-underline", "lg:no-underline",
"lg:pb-2", "lg:pb-2",

View File

@ -8,11 +8,10 @@
</nav> </nav>
{{ define "renderChildren" }} {{ define "renderChildren" }}
{{- $pages := .Pages }} {{- $pages := where .Pages "Params.sitemap" "ne" "false" }}
{{- if .Params.sidebar.reverse }} {{- if .Params.sidebar.reverse }}
{{ $pages = .Pages.Reverse }} {{ $pages = .Pages.Reverse }}
{{- end }} {{- end }}
{{- $pages = where .Pages "Params.sitemap" "ne" "false" }}
{{- $ungrouped := where $pages "Params.sidebar.group" "==" nil }} {{- $ungrouped := where $pages "Params.sidebar.group" "==" nil }}
{{- range $ungrouped }} {{- range $ungrouped }}
{{- if .IsSection }} {{- if .IsSection }}