mirror of
https://github.com/mainnika/nikita-tokarch-uk.git
synced 2026-05-25 01:03:35 +00:00
Implement template helper funcs
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package templates
|
||||
|
||||
import "html/template"
|
||||
|
||||
func UseFuncs() template.FuncMap {
|
||||
return template.FuncMap{
|
||||
"getIndexURL": func() string {
|
||||
return URLIndex
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user