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,7 +35,9 @@ func Render(path string, writer io.Writer, data interface{}) {
return template.HTML(content) return template.HTML(content)
}, },
}).ParseFS(FS, path)) }).ParseFS(FS, path))
FS.templates[path] = tmpl if FS.embedded != nil {
FS.templates[path] = tmpl
}
} }
tmpl.Execute(writer, data) tmpl.Execute(writer, data)
} }