From 06486bdc3c061fee1832edf6efd896adc8f64d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 3 Sep 2021 22:20:53 +0200 Subject: [PATCH] search: disable search in hidden branches #76 1-1-1-1 was previously displayed in the search results --- layouts/index.json | 2 +- layouts/partials/footer.html | 55 ++---------------------------------- layouts/partials/header.html | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 54 deletions(-) diff --git a/layouts/index.json b/layouts/index.json index 4128c70bfc..dc4d9cff74 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,6 @@ {{- $pages := slice }} {{- range .Site.Pages }} -{{- if and (ne .Site.Params.disableSearchHiddenPages true) (or (ne .Params.hidden true) (ne .Title "")) }} +{{- if or (ne (.Scratch.Get "relearnIsHiddenTree") 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/footer.html b/layouts/partials/footer.html index d72f2e75b2..3df7b1ce7c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -7,63 +7,12 @@