Skip to content

Commit

Permalink
hugolib: Fix --uglyURLs from comand line regression
Browse files Browse the repository at this point in the history
This bug was introduced in Hugo 0.33.

Fixes #4343
  • Loading branch information
bep committed Jan 28, 2018
1 parent 3752348 commit 016398f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down

0 comments on commit 016398f

Please sign in to comment.