diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-05-31 10:57:19 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-05-31 10:57:19 +0300 |
commit | 69d92dc49cb8ab9276ab013d427ba2d9aaf9135d (patch) | |
tree | 6b8cad0296ddad4c4c09f0b474742724060d477b /hugolib | |
parent | d74452cfe8f69a85ec83e05481e16bebf199a5cb (diff) |
hugolib: Respect disableKinds=["sitemap"]
Fixes #3544
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/config.go | 1 | ||||
-rw-r--r-- | hugolib/hugo_sites.go | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/config.go b/hugolib/config.go index 8847b3495..e2e9f9329 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -59,6 +59,7 @@ func LoadConfig(fs afero.Fs, relativeSourcePath, configFilename string) (*viper. } if v.IsSet("disableSitemap") { + // NOTE: Do not remove this until Hugo 0.24, ERROR in 0.23. helpers.Deprecated("site config", "disableSitemap", "Use disableKinds= [\"sitemap\"]", false) } diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go index 6e7034bd2..1091660e7 100644 --- a/hugolib/hugo_sites.go +++ b/hugolib/hugo_sites.go @@ -269,6 +269,17 @@ func (h *HugoSites) renderCrossSitesArtifacts() error { return nil } + sitemapEnabled := false + for _, s := range h.Sites { + if s.isEnabled(kindSitemap) { + sitemapEnabled = true + } + } + + if !sitemapEnabled { + return nil + } + // TODO(bep) DRY sitemapDefault := parseSitemap(h.Cfg.GetStringMap("sitemap")) |