From 660fd1c8d41c8205ef0374ebf8a2974af646337d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 21 Sep 2023 17:31:39 +0200 Subject: [PATCH] menu: remove disabled sections from search index #642 --- layouts/_default/index.json | 2 +- layouts/_default/index.search.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/index.json b/layouts/_default/index.json index 74ff61b1a6..f0c5ea4ff2 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -1,7 +1,7 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := slice }} {{- range .Site.Pages }} - {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} + {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} {{- $title := .Title }} {{- if eq .Kind "taxonomy" }} {{- $title = i18n .Data.Plural }} diff --git a/layouts/_default/index.search.js b/layouts/_default/index.search.js index d1c5dfa572..4e98237b5c 100644 --- a/layouts/_default/index.search.js +++ b/layouts/_default/index.search.js @@ -1,7 +1,7 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := slice }} {{- range .Site.Pages }} - {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} + {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} {{- $title := .Title }} {{- if eq .Kind "taxonomy" }} {{- $title = i18n .Data.Plural }}