mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 22:17:28 +00:00
commands, hugolib: Deprecate disable404, disableRSS, disableSitemap, disableRobotsTXT
Use disableKinds instead. Fixes #3345
This commit is contained in:
1 parent
ebf677a583
commit
5794a265b4
2 files changed
+30
No files matched your search
@@ -467,6 +467,19 @@ func (c *commandeer) initializeFlags(cmd *cobra.Command) {
|
|||||||
"noChmod",
|
"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 {
|
for _, key := range persFlagKeys {
|
||||||
c.setValueFromFlag(cmd.PersistentFlags(), key)
|
c.setValueFromFlag(cmd.PersistentFlags(), key)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,23 @@ func LoadConfig(fs afero.Fs, relativeSourcePath, configFilename string) (*viper.
|
|||||||
|
|
||||||
v.RegisterAlias("indexes", "taxonomies")
|
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)
|
loadDefaultSettingsFor(v)
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
|
|||||||
Reference in new issue
Block a user