优化
This commit is contained in:
parent
e178a7bc91
commit
00298c2058
|
@ -27,9 +27,7 @@ func (t *FsTemplate) AddTemplate() {
|
||||||
}
|
}
|
||||||
for _, include := range mainTemplates {
|
for _, include := range mainTemplates {
|
||||||
name := filepath.Base(include)
|
name := filepath.Base(include)
|
||||||
in := append([]string{include}, "layout/*.gohtml")
|
t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, include, "layout/*.gohtml"))
|
||||||
//n := strings.Replace(name, ".gohtml", "", -1)
|
|
||||||
t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, in...))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +35,6 @@ func (t FsTemplate) Instance(name string, data any) render.Render {
|
||||||
r := t.Templates[name]
|
r := t.Templates[name]
|
||||||
return render.HTML{
|
return render.HTML{
|
||||||
Template: r,
|
Template: r,
|
||||||
//Name: name,
|
|
||||||
Data: data,
|
Data: data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user