I try to add icons to my menu based on the value of the .Pre
variable.
Sample (simplified):
config.toml
:
[[menu.main]]
name = "Archiv"
weight = 100
identifier = "archiv"
url = "/archiv/"
pre = "archive"
navigation.html
{{ range .Site.Menus.main }}
{{ if eq .Pre "archive" }}
{{ partial "icons/archive.svg" . }}
{{ end }}
{{ end }}
But it appears that the if-eq-evaluation is returning false (putting parentheses around the eq group does not change it). Why is that?
I verified that the eq query results in false with an {{ else }}
rule echoing the contents of .Pre
.
By the way: trying to load the partial with a variable as a path is not working either, as in
{{ partial .Pre . }}
Maybe .Pre
is not a string at this point?