diff --git a/layouts/robots.txt b/layouts/robots.txt index f26f508..314a7d5 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,7 +1,9 @@ User-agent: * -{{- if hugo.IsProduction | or (eq site.Params.env "production") }} -Disallow: -{{- else }} +{{- if not (hugo.IsProduction | or (eq site.Params.env "production")) }} Disallow: / +{{- else }} +{{- range where site.RegularPages "Params.hiddenPage" true }} +Disallow: {{ .RelPermalink }} +{{- end }} {{- end }} Sitemap: {{ "sitemap.xml" | absURL }}