go(handlers): split get,set funcMap funcs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-05-10 19:17:17 +02:00
parent 2215383c5d
commit 46cc1d663f
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -39,7 +39,11 @@ func listAllTmpls() []string {
// TODO: mimic https://github.com/drone/funcmap/blob/master/funcmap.go
func setFuncMap(t *template.Template) {
t.Funcs(template.FuncMap{
t.Funcs(getFuncMap())
}
func getFuncMap() template.FuncMap {
return template.FuncMap{
"ifIE": func() template.HTML { return template.HTML("<!--[if IE]>") },
"endifIE": func() template.HTML { return template.HTML("<![endif]>") },
"htmlSafe": func(html string) template.HTML {
@ -50,7 +54,7 @@ func setFuncMap(t *template.Template) {
"pageIs": func(want, got string) bool {
return want == got
},
})
}
}
func initTemplates(f fs.FS) {