mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-05-05 01:35:31 +08:00
menu: hide expander when only hidden subpages #264
This commit is contained in:
parent
e88b9ecebb
commit
f65a4b819e
@ -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…
x
Reference in New Issue
Block a user