cache only embedded templates

This commit is contained in:
Nazar Kanaev 2021-03-03 11:43:15 +00:00
parent caabd069d6
commit 7b558c529b

View File

@ -35,8 +35,10 @@ func Render(path string, writer io.Writer, data interface{}) {
return template.HTML(content) return template.HTML(content)
}, },
}).ParseFS(FS, path)) }).ParseFS(FS, path))
if FS.embedded != nil {
FS.templates[path] = tmpl FS.templates[path] = tmpl
} }
}
tmpl.Execute(writer, data) tmpl.Execute(writer, data)
} }