Permalink
Browse files

commands, hugolib: Deprecate disable404, disableRSS, disableSitemap, …

…disableRobotsTXT

Use disableKinds instead.

Fixes #3345
  • Loading branch information...
bep committed May 10, 2017
1 parent ebf677a commit 5794a265b41ffdeebfd8485eecf65cf4088d49d6
Showing with 30 additions and 0 deletions.
  1. +13 −0 commands/hugo.go
  2. +17 −0 hugolib/config.go
View
@@ -467,6 +467,19 @@ func (c *commandeer) initializeFlags(cmd *cobra.Command) {
"noChmod",
}
// Remove these in Hugo 0.23.
if flagChanged(cmd.Flags(), "disable404") {
helpers.Deprecated("command line", "--disable404", "Use --disableKinds=404", false)
}
if flagChanged(cmd.Flags(), "disableRSS") {
helpers.Deprecated("command line", "--disableRSS", "Use --disableKinds=RSS", false)
}
if flagChanged(cmd.Flags(), "disableSitemap") {
helpers.Deprecated("command line", "--disableSitemap", "Use --disableKinds=sitemap", false)
}
for _, key := range persFlagKeys {
c.setValueFromFlag(cmd.PersistentFlags(), key)
}
View
@@ -49,6 +49,23 @@ func LoadConfig(fs afero.Fs, relativeSourcePath, configFilename string) (*viper.
v.RegisterAlias("indexes", "taxonomies")
// Remove these in Hugo 0.23.
if v.IsSet("disable404") {
helpers.Deprecated("site config", "disable404", "Use disableKinds=[\"404\"]", false)
}
if v.IsSet("disableRSS") {
helpers.Deprecated("site config", "disableRSS", "Use disableKinds=[\"RSS\"]", false)
}
if v.IsSet("disableSitemap") {
helpers.Deprecated("site config", "disableSitemap", "Use disableKinds= [\"sitemap\"]", false)
}
if v.IsSet("disableRobotsTXT") {
helpers.Deprecated("site config", "disableRobotsTXT", "Use disableKinds= [\"robotsTXT\"]", false)
}
loadDefaultSettingsFor(v)
return v, nil

0 comments on commit 5794a26

Please sign in to comment.