{{- $url := urls.Parse ("/" | absURL) -}} # robots.txt file for "{{ site.Title }}" website, {{ $url.Host }} User-agent: * {{- if eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }} Allow: / Disallow: /404.html Disallow: /thanks Sitemap: {{ "/sitemap.xml" | absURL }} {{- else }} Disallow: / {{- end }}