Template function where with boolean and operator with not set params

Can where function process bool?

here is the document

---
main: true
---
abcd

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.


edit:

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

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

return nothing.

thanks

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

See:

1 Like

ah… nice. nil

should we put this into the documentation?

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

1 Like