mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Allow 1/0 for true/false in Yaml front-matter
This commit is contained in:
parent
0c348f8531
commit
0926523ba6
1 changed files with 5 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue