From fba6646926e4beef41c74fe6e16e254cb245acda Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 21 Aug 2023 16:26:30 -0600 Subject: [PATCH] added ability to noindex specific pages --- layouts/robots.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/robots.txt b/layouts/robots.txt index 020760bad..3965018d4 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,2 +1,6 @@ User-agent: * -{{ if eq .Site.Params.environment "staging" }}Disallow: /{{ end }} \ No newline at end of file +{{- if eq .Site.Params.environment "staging" }}Disallow: / +{{- else }}{{ range where .Site.Pages ".Params.noindex" true }} +Disallow: {{ .RelPermalink }} +{{ end -}} +{{ end -}} \ No newline at end of file