projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4af4f6
)
Allow 1/0 for true/false in Yaml front-matter
author
Ask Bjørn Hansen
<ask@develooper.com>
Sun, 16 Feb 2014 09:22:47 +0000
(
01:22
-0800)
committer
spf13
<steve.francia@gmail.com>
Tue, 18 Feb 2014 23:44:47 +0000
(18:44 -0500)
hugolib/metadata.go
patch
|
blob
|
history
diff --git
a/hugolib/metadata.go
b/hugolib/metadata.go
index dcef03c9ca40d4f94bda2bceebff892a220d65f4..6d4a19c1e0104715c94fc0e94481431b5bd3e6fd 100644
(file)
--- 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")
}