hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit b41622bc49e3a1a7281dfcd54de0184a10c7a77f
parent e4af4f652e145adac7d69f8a2524a45bd3e000f6
Author: Ask Bjørn Hansen <ask@develooper.com>
Date:   Sun, 16 Feb 2014 01:22:47 -0800

Allow 1/0 for true/false in Yaml front-matter

Diffstat:
Mhugolib/metadata.go | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git 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")
 	}