Permalink
Browse files

Allow global disallow of search engines for pre-launched sites

  • Loading branch information...
crgeary committed Mar 28, 2018
1 parent 0a7702f commit d623b23008c55643cc07e95eafb74d2643809e45
Showing with 8 additions and 1 deletion.
  1. +3 −0 config.toml
  2. +5 −1 layouts/robots.txt
@@ -5,6 +5,9 @@ title = "{TITLE}"
enableRobotsTXT = true
disableAliases = true
[params]
disallow_search_engines = false # set robots.txt to disallow everything
# add redirects/headers
[outputs]
home = ["HTML", "RSS", "REDIRECTS", "HEADERS"]
@@ -1,2 +1,6 @@
User-agent: *
Disallow: {{ if ne (getenv "HUGO_ENV") "production" }}/{{ end }}
{{- if .Site.Params.disallow_search_engines }}
Disallow: /
{{ else }}
Disallow: {{ if ne (getenv "HUGO_ENV") "production" }}/{{ end }}
{{ end }}

0 comments on commit d623b23

Please sign in to comment.