From af403dd26254afa8c2ec2023799b8146a466e67c Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sat, 25 Dec 2021 14:59:08 +0100 Subject: [PATCH] hide search page from search results --- content/search.md | 2 ++ layouts/_default/search.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/content/search.md b/content/search.md index ec905d4..e56adab 100644 --- a/content/search.md +++ b/content/search.md @@ -5,4 +5,6 @@ outputs: - "html" - "json" norss: true +nosearch: true +comments: false --- diff --git a/layouts/_default/search.json b/layouts/_default/search.json index ce3d578..5f04f46 100644 --- a/layouts/_default/search.json +++ b/layouts/_default/search.json @@ -2,7 +2,8 @@ { {{ $mscratch := newScratch }} {{ $mscratch.Add "articles" slice }} - {{ range .Site.RegularPages }} + {{ $pages := where .Site.RegularPages "Params.nosearch" "!=" "true" }} + {{ range $pages }} {{ $mscratch.Add "articles" (dict "title" .Title "date" (.Date.Format "2006-01-02")