new ui
This commit is contained in:
parent
7c756e87c1
commit
d69d8c3857
24 changed files with 3421 additions and 859 deletions
|
|
@ -14,8 +14,12 @@ var templates embed.FS
|
|||
|
||||
func (h *Server) loadTemplates() {
|
||||
h.tmpl = make(map[string]*template.Template)
|
||||
funcs := template.FuncMap{
|
||||
"add": func(a, b int) int { return a + b },
|
||||
"mult": func(a, b int) int { return a * b },
|
||||
}
|
||||
for _, page := range h.routes {
|
||||
tmpl, err := template.ParseFS(templates,
|
||||
tmpl, err := template.New("").Funcs(funcs).ParseFS(templates,
|
||||
"templates/layout/*.gohtml",
|
||||
"templates/"+page.template+".gohtml",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue