mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 09:57:16 -04:00
Allow 1/0 for true/false in Yaml front-matter
This commit is contained in:
parent
e4af4f652e
commit
b41622bc49
@ -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…
x
Reference in New Issue
Block a user