twbs--bootstrap/site/layouts/robots.txt

13 lines
365 B
Plaintext
Raw Normal View History

# www.robotstxt.org
{{- $isProduction := eq (getenv "HUGO_ENV") "production" -}}
{{- $isNetlify := eq (getenv "NETLIFY") "true" -}}
{{- $allowCrawling := and (not $isNetlify) $isProduction -}}
{{ if $allowCrawling }}
# Allow crawling of all content
{{- end }}
User-agent: *
Disallow:{{ if not $allowCrawling }} /{{ end }}
Sitemap: {{ .Site.BaseURL }}/sitemap.xml