mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Allow 1/0 for true/false in Yaml front-matter
This commit is contained in:
@@ -71,6 +71,11 @@ func interfaceToBool(i interface{}) bool {
|
|||||||
switch b := i.(type) {
|
switch b := i.(type) {
|
||||||
case bool:
|
case bool:
|
||||||
return b
|
return b
|
||||||
|
case int:
|
||||||
|
if i.(int) > 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
default:
|
default:
|
||||||
errorf("Only Boolean values are supported for this YAML key")
|
errorf("Only Boolean values are supported for this YAML key")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user