Permalink
Browse files

hugolib: Respect disableKinds=["sitemap"]

Fixes #3544
  • Loading branch information...
bep committed May 31, 2017
1 parent d74452c commit 69d92dc49cb8ab9276ab013d427ba2d9aaf9135d
Showing with 12 additions and 0 deletions.
  1. +1 −0 hugolib/config.go
  2. +11 −0 hugolib/hugo_sites.go
View
@@ -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)
}
View
@@ -269,6 +269,17 @@ func (h *HugoSites) renderCrossSitesArtifacts() error {
return nil
}
sitemapEnabled := false
for _, s := range h.Sites {
if s.isEnabled(kindSitemap) {
sitemapEnabled = true

This comment has been minimized.

Show comment
Hide comment
@bogem

bogem May 31, 2017

Contributor

I think, it would be useful to break statement after this line, because sitemapEnabled will not be changed after it is set to true.

@bogem

bogem May 31, 2017

Contributor

I think, it would be useful to break statement after this line, because sitemapEnabled will not be changed after it is set to true.

This comment has been minimized.

Show comment
Hide comment
@bep

bep May 31, 2017

Member

Useful to who? It's not like it is a performance issue unless you have 1000 languages.

@bep

bep May 31, 2017

Member

Useful to who? It's not like it is a performance issue unless you have 1000 languages.

This comment has been minimized.

Show comment
Hide comment
@bogem

bogem May 31, 2017

Contributor

Yes, but anyway it's a good practice.

@bogem

bogem May 31, 2017

Contributor

Yes, but anyway it's a good practice.

This comment has been minimized.

Show comment
Hide comment
@bep

bep May 31, 2017

Member

I agree, which is why I fixed it ... it was just your use of the word "useful" ... :-)

@bep

bep May 31, 2017

Member

I agree, which is why I fixed it ... it was just your use of the word "useful" ... :-)

}
}
if !sitemapEnabled {
return nil
}
// TODO(bep) DRY
sitemapDefault := parseSitemap(h.Cfg.GetStringMap("sitemap"))

0 comments on commit 69d92dc

Please sign in to comment.