summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-28 17:03:10 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-28 17:03:10 +0100
commit016398ffe2e0a073453cf46a9d6bf72d693c11e5 (patch)
treefba2299d45d6029bc8e3ff93779d02f40fc9e995 /hugolib
parent3752348ef13ced8f6f528b42ee7d76a12a97ae5c (diff)
hugolib: Fix --uglyURLs from comand line regression
This bug was introduced in Hugo 0.33. Fixes #4343
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/site.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index 55eb6ae72..ece4e07af 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -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()]