diff --git a/layouts/index.json b/layouts/index.json index dc4d9cff74..6e5fc4cc34 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,6 @@ {{- $pages := slice }} {{- range .Site.Pages }} -{{- if or (ne (.Scratch.Get "relearnIsHiddenTree") true) (ne .Site.Params.disableSearchHiddenPages true) }} +{{- if or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) }} {{- $pages = $pages | append (dict "uri" .RelPermalink "title" .Title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }} {{- end }} {{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index dc049fee5e..79f1d1ace0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -59,16 +59,15 @@ {{- $isPostSelf := and ($isSelfFound) (not $isSelf) }} {{- $hidden_node := or (.node.Params.hidden) (eq .node.Title "") }} - {{- $hidden_tree:= or $hidden_node .hidden }} + {{- $hidden_stem:= or $hidden_node .hidden }} {{- $hidden_from_current := or (and $hidden_node (not $isAncestor) (not $isSelf) ) (and .hidden (or $isPreSelf $isPostSelf $isDescendant) ) }} {{- .node.Scratch.Set "relearnIsHiddenNode" $hidden_node}} - {{- .node.Scratch.Set "relearnIsHiddenTree" $hidden_tree}} - {{- .node.Scratch.Set "relearnIsHiddenFromCurrent" $hidden_from_current}} + {{- .node.Scratch.Set "relearnIsHiddenStem" $hidden_stem}} {{- if not $hidden_from_current }} - {{- if and $isPreSelf (or $isOther $isAncestor ) }} + {{- if $isPreSelf }} {{- $currentNode.Scratch.Set "relearnPrevPage" .node }} - {{- else if and $isPostSelf (or $isOther $isDescendant) (eq ($currentNode.Scratch.Get "relearnNextPage") nil) }} + {{- else if and $isPostSelf (eq ($currentNode.Scratch.Get "relearnNextPage") nil) }} {{- $currentNode.Scratch.Set "relearnNextPage" .node }} {{- end}} {{- end }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 0d135d4efc..a1f9828266 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -105,11 +105,12 @@ {{ $alwaysopen := .alwaysopen }} {{ with $currentNode.File }}{{ $currentFileUniqueID = .UniqueID }}{{ end }} {{with .sect}} - {{ $hidden := and (or (.Params.hidden) (eq .Title "")) (not $.showhidden) }} - {{if .IsSection }} + {{ $hidden := and (eq (.Scratch.Get "relearnIsHiddenStem") true) (not $.showhidden) (not (.IsAncestor $currentNode))}} + {{if $hidden }} + {{else if .IsSection }} {{safeHTML .Params.head}} {{ $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }} -