From 41549ec311cdd823987ff61082e8718451da89b9 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 26 Mar 2022 16:57:45 +0100 Subject: Add robots.txt --- layouts/robots.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 layouts/robots.txt (limited to 'layouts/robots.txt') 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 }} -- cgit v1.2.3