Skip to content

Commit

Permalink
menu: hide expander when only hidden subpages #264
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Jun 6, 2022
1 parent e88b9ec commit f65a4b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit f65a4b8

Please sign in to comment.