Inside a partial, why does this work
{{ $foo := .Site.Params.foo }}
{{ range $action := .Site.Params.header.nav_links }}
{{ if $foo }}
<a href="{{ $action.url | relURL }}">{{ $action.label }}</a>
{{ end }}
{{ end}}
but this doesn’t
{{ range $action := .Site.Params.header.nav_links }}
{{ if .Site.Params.foo }}
<a href="{{ $action.url | relURL }}">{{ $action.label }}</a>
{{ end }}
{{ end}}
?
config.yaml has
[...]
params:
foo: true
header:
nav_links:
- label: Home
url: /
- label: Support
url: /support/
[..]