From 7b9c836416db8f9d1f5a07e30b336566c838a1cb Mon Sep 17 00:00:00 2001 From: Martin Pittermann Date: Sun, 22 May 2022 07:43:50 +0200 Subject: [PATCH] Add robotsNoIndex parameter (#900) - adds the ability to use the noindex and nofollow parameters for specific pages in production mode, preventing e.g. the imprint from showing up in search engines. - Usage: In post front-matter add, --- robotsNoIndex: true --- --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b9214525..b0e47876 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,7 +1,7 @@ -{{- if hugo.IsProduction | or (eq site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} {{- else }}