diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-14 00:58:20 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-14 00:58:20 +0200 |
| commit | e94a222c9cf28be8884867696222296fc710b985 (patch) | |
| tree | 7cbca0e878f104365de1fd44e5092e921dec5a10 /layouts/robots.txt | |
| parent | 0e59801aa257d0b7413c3f90cc0f4ada24c00d53 (diff) | |
| download | gohugo-theme-ed-e94a222c9cf28be8884867696222296fc710b985.tar.gz | |
Rework robots.txt file
Diffstat (limited to 'layouts/robots.txt')
| -rw-r--r-- | layouts/robots.txt | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/layouts/robots.txt b/layouts/robots.txt index 7a24e82..9f95983 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,8 +1,12 @@ +{{- $url := urls.Parse site.BaseURL -}} +# robots.txt file for "{{ site.Title }}", {{ $url.Host }} User-agent: * -# robotstxt.org - if ENV production variable is false robots will be disallowed. -{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }} Allow: / -Sitemap: {{.Site.BaseURL}}/sitemap.xml -{{ else }} +Sitemap: {{ site.BaseURL }}/sitemap.xml +{{- else }} Disallow: / -{{ end }} +{{- end }} + +# TODO: implement sitemap.xml +# Sitemap: {{ site.BaseURL }}/sitemap.xml |
