Closed armandocerna closed 3 months ago
rather than passing the hostname in as a variable, how about registering a function that can be used in all of the templates? It feels a tiny bit wrong to use "go" as the func name, since it's already a keyword, but it works pretty well since it's not actually a registered template func. So something like:
tmplFuncs := template.FuncMap{
"go": func() string {
return *hostname
},
}
which is registered on all of the templates, and then inside the template files themselves, we can use {{go}}
, which is still quite readable. I've got the start of this working if you're okay with me pushing it to your branch?
Much cleaner, I like it! Totally ok with you pushing to my branch.
I saw you were curious, very simple change we use so
for the hostname we have an internal cli utility named the same
We would like our html templates to reflect the hostname override we are passing to golink, these changes pass the hostname to all HTML templates