diff options
| -rw-r--r-- | exampleSite/config.toml | 6 | ||||
| -rw-r--r-- | layouts/robots.txt | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 998bf5a..4bf5dcb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,6 +5,7 @@ defaultContentLanguage = 'en' title = 'Ed.' theme = ['github.com/sergeyklay/gohugo-theme-ed'] resourceDir = '../resources' +enableRobotsTXT = true [languages] [languages.en] @@ -69,6 +70,11 @@ resourceDir = '../resources' url = '/documentation/' weight = 4 [[menu.main]] + identifier = 'search' + name = 'Search' + url = '/search/' # TODO: Implement search + weight = 5 + [[menu.main]] identifier = 'github' name = 'GitHub Project' url = 'https://github.com/sergeyklay/gohugo-theme-ed/' 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 |
