I want to let users defining a themeColor by setting .Site.Params.themeColor
to the wished color. The variable acts as prefix for the name of the stylesheets’ path (like <themeColor>-theme.html
).
Firstly, I tried to use printf
with the + operator:
{{ parial "themes/" + (printf "%s" .Site.Params.themeColor) + "-theme.html" }}
It looks like the + operator doesn’t works as expected, since Go doesn’t seem to support concatenation this way. My second approach was to insert the variable directly into the string, but it will not be interpreted:
{{ parial "themes/{{ .Site.Params.themeColor }}-theme.html" }}
Is there any workaround for that?