contrib icon indicating copy to clipboard operation
contrib copied to clipboard

Gin and pongo2 template engine

Open nguyenthenguyen opened this issue 9 years ago • 3 comments

nguyenthenguyen avatar May 23 '15 16:05 nguyenthenguyen

@joonathan FromCache is better

nguyenthenguyen avatar May 23 '15 22:05 nguyenthenguyen

Could you also expose TemplateSet.Debugvariable or use gin's IsDebugging to switch this. This would enable dynamic reloading of Cached templates.

"FromCache() is a convenient method to cache templates. It is thread-safe and will only compile the template associated with a filename once. If TemplateSet.Debug is true (for example during development phase), FromCache() will not cache the template and instead recompile it on any call (to make changes to a template live instantaneously). Like FromFile(), FromCache() takes a relative path to a set base directory. Sandbox restrictions apply (if given)."

joonathan avatar Jun 10 '15 08:06 joonathan

Interesting, I implemented something similar as a standalone library: https://gitlab.com/go-box/pongo2gin that was before I saw this PR.

edit: I updated the link, that repo is under gitlab.com/go-box for quite a few years already. I forgot all about this issue so have updated my comment.

robvdl avatar Aug 30 '15 08:08 robvdl