summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-03-26 16:57:45 +0100
committerSerghei Iakovlev <egrep@protonmail.ch>2022-03-26 16:57:45 +0100
commit41549ec311cdd823987ff61082e8718451da89b9 (patch)
tree787e66311cfde6961d3f8f672af87526fe17311f
parent131f980eb3060887e76745411e1eca82defb5d73 (diff)
downloadgohugo-theme-ed-41549ec311cdd823987ff61082e8718451da89b9.tar.gz
Add robots.txt
-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 }}