From 0c28a4ad5a41b0479cc1e517fbb609a3c4b73f67 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 30 Jan 2021 12:50:16 +0530 Subject: [PATCH] introduce searchHidden front-matter var - to hide particular pages from search usage: in page's front-matter add searchHidden: true --- layouts/_default/index.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/_default/index.json b/layouts/_default/index.json index deef3c9..436f9e6 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -1,6 +1,7 @@ {{- $.Scratch.Add "index" slice -}} {{- range .Site.RegularPages -}} + {{- if not .Params.searchHidden }} {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} + {{- end }} {{- end -}} {{- $.Scratch.Get "index" | jsonify -}} -