mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
parent
ad4bc969da
commit
03cb38e6c6
2 changed files with 35 additions and 1 deletions
|
@ -222,7 +222,12 @@ func (c *Config) CompileConfig() error {
|
|||
}
|
||||
disabledKinds := make(map[string]bool)
|
||||
for _, kind := range c.DisableKinds {
|
||||
disabledKinds[strings.ToLower(kind)] = true
|
||||
kind = strings.ToLower(kind)
|
||||
if kind == "taxonomyterm" {
|
||||
// Legacy config.
|
||||
kind = "term"
|
||||
}
|
||||
disabledKinds[kind] = true
|
||||
}
|
||||
kindOutputFormats := make(map[string]output.Formats)
|
||||
isRssDisabled := disabledKinds["rss"]
|
||||
|
|
|
@ -897,3 +897,32 @@ mainSections: []
|
|||
`)
|
||||
|
||||
}
|
||||
|
||||
func TestConfigLegacyValues(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
# taxonomyTerm was renamed to term in Hugo 0.60.0.
|
||||
disableKinds = ["taxonomyTerm"]
|
||||
|
||||
-- layouts/index.html --
|
||||
Home
|
||||
|
||||
`
|
||||
|
||||
b, err := NewIntegrationTestBuilder(
|
||||
IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
},
|
||||
).BuildE()
|
||||
|
||||
b.Assert(err, qt.IsNil)
|
||||
b.AssertFileContent("public/index.html", `
|
||||
Home
|
||||
`)
|
||||
|
||||
conf := b.H.Configs.Base
|
||||
b.Assert(conf.IsKindEnabled("term"), qt.Equals, false)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue