From e0ddce45e4c73b2778cec64f0c8828438531e00b Mon Sep 17 00:00:00 2001 From: Will Faught Date: Tue, 13 Dec 2022 21:51:53 -0800 Subject: [PATCH] Add excludesearch page parameter --- README.md | 2 ++ layouts/_default/home.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fb5b83b..79c57fd8 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,8 @@ The `paige-search` layout provides full site search. It requires setting Set page parameter `excluderss` to true to exclude it from RSS. Doing so for a list page excludes the entire directory. +Set page parameter `excludesearch` to true to exclude it from search. + If `partials/paige-head-last.html` exists in the site, it is included at the end of the head tag. If `partials/paige-body-last.html` exists in the site, it is included at the end of the body tag. diff --git a/layouts/_default/home.json b/layouts/_default/home.json index ade5dcf8..9de28841 100644 --- a/layouts/_default/home.json +++ b/layouts/_default/home.json @@ -1,5 +1,5 @@ {{- $.Scratch.Add "index" slice -}} -{{- range .Site.RegularPages -}} +{{- range where .Site.RegularPages "Params.excludesearch" "ne" true -}} {{- $.Scratch.Add "index" (dict "title" (.Title | markdownify | plainify | htmlUnescape) "description" (.Description | markdownify | plainify | htmlUnescape) "date" .PublishDate "categories" .Params.categories "tags" .Params.tags "keywords" .Params.keywords "text" (strings.TrimRight " " (replace (.Plain | htmlUnescape) "\n" " ")) "link" .RelPermalink) -}} {{- end -}} {{- $.Scratch.Get "index" | jsonify -}}