contrib
contrib copied to clipboard
Gin and pongo2 template engine
@joonathan FromCache is better
Could you also expose TemplateSet.Debug
variable 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)."
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.