mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
57151a5e91
commit
ea633dd809
2 changed files with 20 additions and 0 deletions
|
@ -160,3 +160,21 @@ title: "p3"
|
|||
b.AssertFileExists("public/page/1/index.html", false)
|
||||
b.AssertFileContent("public/page/2/index.html", "pagination-default")
|
||||
}
|
||||
|
||||
|
||||
func TestMapUglyURLs(t *testing.T) {
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
[uglyurls]
|
||||
posts = true
|
||||
`
|
||||
|
||||
b := hugolib.Test(t, files)
|
||||
|
||||
c := b.H.Configs.Base
|
||||
|
||||
mapUglyURLs, isMap := c.UglyURLs.(map[string]bool)
|
||||
|
||||
b.Assert(isMap, qt.Equals, true)
|
||||
b.Assert(mapUglyURLs["posts"], qt.Equals, true)
|
||||
}
|
||||
|
|
|
@ -419,6 +419,8 @@ var allDecoderSetups = map[string]decodeWeight{
|
|||
p.c.UglyURLs = vv
|
||||
case string:
|
||||
p.c.UglyURLs = vv == "true"
|
||||
case maps.Params:
|
||||
p.c.UglyURLs = cast.ToStringMapBool(maps.CleanConfigStringMap(vv))
|
||||
default:
|
||||
p.c.UglyURLs = cast.ToStringMapBool(v)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue