Hi everyone,
I am trying to pass a variable from my partial but it just renders as empty content, when I add the “.” then it renders fine so don’t understand why??
{{ if .Site.Params.Foo.baz }}
<a href="https://www.example.com/{{ .Site.Params.Foo.baz}}" class="{{ .class }}" title="Example">Example</a>
{{ end }}
I would like to pass {{ .class }} to my partial as I want to use the menu on a few different pages and want to be able to set the class variable from the partial dict.
wow the legend himself, thank you so much for the quick reply! I will try this. I just didn’t understand why the dict wasn’t passing, is it because its within an if statement?
Thank you so much! I see now I have to pass the contextual dot over if I want to use .Site.Params I see now, thanks for the I will give it a go! I have two solutions to one problem. Thank you for your time!