0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-02 14:24:19 +01:00
Bootstrap/site/layouts/robots.txt
XhmikosR 1ebb8e7d9b
robots.txt: adapt for Netlify. (#29192)
Since we build with `HUGO_ENV` set to `production` on Netlify, use another variable to prevent crawling.
2019-08-02 17:26:25 +03:00

13 lines
365 B
Plaintext

# 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