mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
menu: hide expander when only hidden subpages #264
This commit is contained in:
parent
e88b9ecebb
commit
f65a4b819e
1 changed files with 3 additions and 1 deletions
|
@ -131,8 +131,10 @@
|
|||
{{- else if or .IsSection .IsHome }}
|
||||
{{- $numberOfVisibleChildren := 0 }}
|
||||
{{- range $pages }}
|
||||
{{- $isSelfSub := eq .RelPermalink $currentFileRelPermalink }}
|
||||
{{- $isAncestorSub := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||
{{- $relearnIsSubHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||
{{- $subHidden := and $relearnIsSubHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||
{{- $subHidden := and $relearnIsSubHiddenFrom (not $.showhidden) (not $isSelfSub) (not $isAncestorSub) }}
|
||||
{{- $numberOfVisibleChildren = add $numberOfVisibleChildren (int (not $subHidden)) }}
|
||||
{{- end }}
|
||||
{{- safeHTML .Params.head }}
|
||||
|
|
Loading…
Reference in a new issue