mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
1ebb8e7d9b
Since we build with `HUGO_ENV` set to `production` on Netlify, use another variable to prevent crawling.
12 lines
365 B
Text
12 lines
365 B
Text
# 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
|