diff --git a/frontend/templates/funcs.go b/frontend/templates/funcs.go new file mode 100644 index 0000000..3315be5 --- /dev/null +++ b/frontend/templates/funcs.go @@ -0,0 +1,11 @@ +package templates + +import "html/template" + +func UseFuncs() template.FuncMap { + return template.FuncMap{ + "getIndexURL": func() string { + return URLIndex + }, + } +} diff --git a/frontend/templates/templates.go b/frontend/templates/templates.go index 7379386..842e2f0 100644 --- a/frontend/templates/templates.go +++ b/frontend/templates/templates.go @@ -25,6 +25,7 @@ var Templates *template.Template func init() { Templates = template.New("") + Templates.Funcs(UseFuncs()) tmplNames, err := fs.Glob(content, "*.go.tmpl") if err != nil {