Template function where with boolean and operator with not set params

Can where function process bool?

here is the document

main: true

In template, running this

{{ range (where .Site.Pages ".Params.main" true) }}
    {{ .Title }}
{{ end }}

return nothing.

I know I can convert it to string “true” as work around but I think bool should be allowed.


with 3 document, only 1 doc with “main: true”, the rest are not set.

{{ range (where .Site.Pages ".Params.main" "ne" "true" ) }}

return nothing.


Hugo Static Site Generator v0.15-DEV BuildDate: 2015-08-07T20:31:20+07:00


1 Like

ah… nice. nil

should we put this into the documentation?

edit: raised here https://github.com/spf13/hugo/issues/1341

1 Like