mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 21:19:19 +00:00
cache only embedded templates
This commit is contained in:
parent
caabd069d6
commit
7b558c529b
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user