mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
hugolib: Fix --uglyURLs from comand line regression
This bug was introduced in Hugo 0.33. Fixes #4343
This commit is contained in:
parent
3752348ef1
commit
016398ffe2
1 changed files with 9 additions and 2 deletions
|
@ -1038,11 +1038,18 @@ func (s *Site) initializeSiteInfo() {
|
|||
|
||||
v := s.Cfg.Get("uglyURLs")
|
||||
if v != nil {
|
||||
if vv, ok := v.(bool); ok {
|
||||
switch vv := v.(type) {
|
||||
case bool:
|
||||
uglyURLs = func(p *Page) bool {
|
||||
return vv
|
||||
}
|
||||
} else {
|
||||
case string:
|
||||
// Is what be get from CLI (--uglyURLs)
|
||||
vvv := cast.ToBool(vv)
|
||||
uglyURLs = func(p *Page) bool {
|
||||
return vvv
|
||||
}
|
||||
default:
|
||||
m := cast.ToStringMapBool(v)
|
||||
uglyURLs = func(p *Page) bool {
|
||||
return m[p.Section()]
|
||||
|
|
Loading…
Reference in a new issue