shithub: hugo

Download patch

ref: b41622bc49e3a1a7281dfcd54de0184a10c7a77f
parent: e4af4f652e145adac7d69f8a2524a45bd3e000f6
author: Ask Bjørn Hansen <[email protected]>
date: Sat Feb 15 20:22:47 EST 2014

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

--- a/hugolib/metadata.go
+++ b/hugolib/metadata.go
@@ -71,6 +71,11 @@
 	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")
 	}