From: Ask Bjørn Hansen Date: Sun, 16 Feb 2014 09:22:47 +0000 (-0800) Subject: Allow 1/0 for true/false in Yaml front-matter X-Git-Tag: v0.10~19 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b41622bc49e3a1a7281dfcd54de0184a10c7a77f;p=brevno-suite%2Fhugo Allow 1/0 for true/false in Yaml front-matter --- diff --git a/hugolib/metadata.go b/hugolib/metadata.go index dcef03c9..6d4a19c1 100644 --- a/hugolib/metadata.go +++ b/hugolib/metadata.go @@ -71,6 +71,11 @@ func interfaceToBool(i interface{}) bool { switch b := i.(type) { case bool: return b + case int: + if i.(int) > 0 { + return true + } + return false default: errorf("Only Boolean values are supported for this YAML key") }