menu: let arrow navigation respect ordersectionsby configuration #170

This commit is contained in:
Sören Weber 2022-02-07 22:24:57 +01:00
parent 017f1004ab
commit 6b943aec76
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -6,7 +6,7 @@
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }} {{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }} {{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }} {{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false }} {{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" .Site.Params.ordersectionsby }}
{{- define "relearn-structure" }} {{- define "relearn-structure" }}
{{- $currentNode := .currentnode }} {{- $currentNode := .currentnode }}
{{- $isSelf := eq $currentNode.RelPermalink .node.RelPermalink }} {{- $isSelf := eq $currentNode.RelPermalink .node.RelPermalink }}
@ -45,15 +45,17 @@
{{- end }} {{- end }}
{{- $pages := ($currentNode.Scratch.Get "relearnSubPages") }} {{- $pages := ($currentNode.Scratch.Get "relearnSubPages") }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .defaultOrdersectionsby }}
{{- $currentOrdersectionsby := .node.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .node.Params.ordersectionsby | default $defaultOrdersectionsby }}
## {{ .defaultOrdersectionsby}} {{ $currentOrdersectionsby }}
{{- if eq $currentOrdersectionsby "title"}} {{- if eq $currentOrdersectionsby "title"}}
{{- range $pages.ByTitle }} {{- range $pages.ByTitle }}
{{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current }} {{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current "defaultOrdersectionsby" $defaultOrdersectionsby }}
{{- end}} {{- end}}
{{- else}} {{- else}}
{{- range $pages.ByWeight }} {{- range $pages.ByWeight }}
{{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current }} {{- template "relearn-structure" dict "node" . "currentnode" $currentNode "hiddenstem" $hidden_stem "hiddencurrent" $hidden_from_current "defaultOrdersectionsby" $defaultOrdersectionsby }}
{{- end}} {{- end}}
{{- end }} {{- end }}
{{- end }} {{- end }}