Say I have {{ partial "li.html" $test $root.Data.Term }}
.
With this I can can access the first parameter, or $test
, by simply refering to .
within the li.html
template, but how do I access the second or additional parameter ($root.Data.Term
) from within the same template?
I would suggest using the hugo dict function. It allows you to use key/value pairs to pass information. The documentation states that for your use case.
You can then access the values by just using {{ .test }} and {{ .term }}.
Alternatively you can use the scratch function, which is a more "global" approach.