summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--layouts/robots.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/robots.txt b/layouts/robots.txt
new file mode 100644
index 0000000..7a24e82
--- /dev/null
+++ b/layouts/robots.txt
@@ -0,0 +1,8 @@
+User-agent: *
+# robotstxt.org - if ENV production variable is false robots will be disallowed.
+{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
+Allow: /
+Sitemap: {{.Site.BaseURL}}/sitemap.xml
+{{ else }}
+Disallow: /
+{{ end }}