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 }} -
  • +
  • {{ partial "menu-pre.html" . }}{{or .Params.menuTitle .LinkTitle .Title}}{{ partial "menu-post.html" . }} {{ if $showvisitedlinks}}{{end}} diff --git a/static/css/theme.css b/static/css/theme.css index 203fc00e27..39c175fdd7 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -210,7 +210,7 @@ textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[typ #sidebar ul.topics.searched ul { display: block; } -#sidebar ul.topics ul, #sidebar ul.topics li.hidden { +#sidebar ul.topics ul { display: none; } #sidebar ul.topics > li > ul > li:last-child { @@ -219,8 +219,8 @@ textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[typ #sidebar ul.topics ul ul { padding-bottom: 0; } -#sidebar ul.topics li.parent > ul, #sidebar ul.topics li.parent.hidden, -#sidebar ul.topics li.active > ul, #sidebar ul.topics li.active.hidden, +#sidebar ul.topics li.parent > ul, +#sidebar ul.topics li.active > ul, #sidebar ul.topics li.alwaysopen > ul { display: block; }