From 77baa3d76ea400ff4c3f81f7fb90e21b15cf992f Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 8 Nov 2020 22:30:33 +0530 Subject: [PATCH] layouts: add robots.txt used when enableRobotsTXT: true https://gohugo.io/templates/robots/ --- layouts/robots.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 layouts/robots.txt diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 00000000..35f59d15 --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,7 @@ +User-agent: * +{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +Disallow: +{{- else }} +Disallow: / +{{- end }} +Sitemap: {{ "sitemap.xml" | absURL }}