0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/site/layouts/robots.txt
XhmikosR b8ffcdf9a4
Use hugo.Environment instead of getenv (#29240)
This is set automatically to "development" when the local server is running, and to "production" when Hugo builds the site.
2020-02-22 08:54:43 +02:00

13 lines
360 B
Plaintext

# www.robotstxt.org
{{- $isProduction := eq hugo.Environment "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: {{ "/sitemap.xml" | absURL }}