From d51f514b90f0b2bcc7fe618f20a9399b84829a7d Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 22 Apr 2021 21:25:43 +0200 Subject: [PATCH] feat: add option geekdocProtected to exclude pages from data file (#97) --- assets/search-data.json | 2 +- exampleSite/content/usage/configuration.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/search-data.json b/assets/search-data.json index b337f9b..7bc1955 100644 --- a/assets/search-data.json +++ b/assets/search-data.json @@ -1,5 +1,5 @@ [ - {{ range $index, $page := .Site.Pages }} + {{ range $index, $page := (where .Site.Pages "Params.geekdocprotected" "ne" true) }} {{ if ne $index 0 }},{{ end }} { "id": {{ $index }}, diff --git a/exampleSite/content/usage/configuration.md b/exampleSite/content/usage/configuration.md index a949126..5033f54 100644 --- a/exampleSite/content/usage/configuration.md +++ b/exampleSite/content/usage/configuration.md @@ -230,6 +230,12 @@ geekdocCollapseSection = true # Add an anchor link to headlines. geekdocAnchor = true + +# If you have protected some pages with e.g. basic authentication you may want to exclude these pages +# from data file, otherwise information may be leaked. Setting this parameter to 'true' will exclude the +# page from search data, feeds, etc. +# WARNING: Consider hosting a standalone, fully auth-protected static page for secret information instead! +geekdocProtected: false ``` {{< /tab >}} @@ -277,6 +283,12 @@ geekdocCollapseSection: true # Add an anchor link to headlines. geekdocAnchor: true + +# If you have protected some pages with e.g. basic authentication you may want to exclude these pages +# from data file, otherwise information may be leaked. Setting this parameter to 'true' will exclude the +# page from search data, feeds, etc. +# WARNING: Consider hosting a standalone, fully auth-protected static page for secret information instead! +geekdocProtected: false ``` {{< /tab >}}