Implement template helper funcs

This commit is contained in:
2021-12-03 04:11:38 +01:00
parent 422bcbf82c
commit 8f4d4ff1ba
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
package templates
import "html/template"
func UseFuncs() template.FuncMap {
return template.FuncMap{
"getIndexURL": func() string {
return URLIndex
},
}
}
+1
View File
@@ -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 {