Hi,
I noticed a strange - to me - behaviour in the logic of conditional statements.
Let’s start from the docs regarding the rules of conditionals:
Go Templates treat the following values as false:
false; 0; any array, slice, map, or string of length zero
Now, I created in my config.toml
this variable
[params]
foo=false
and then in index.html
:
{{ if isset .Site.Params "foo" }}
<h1>FOO</h1>
{{ end }}
Well, the problem is that FOO is displayed although it’s set on false
. If I remove the variable in the config.toml
file, it correctly doesn’t display FOO.
Am I missing something?