mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
menu: let arrow navigation respect ordersectionsby configuration #170
This commit is contained in:
parent
017f1004ab
commit
6b943aec76
1 changed files with 6 additions and 4 deletions
|
@ -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 }}
|
Loading…
Reference in a new issue