djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.5k stars 221 forks source link

Lazy loading or runtime templates #1078

Closed baron-digit closed 4 months ago

baron-digit commented 4 months ago

Hi,

Is there a way to switch from compile time loading of the templates to runtime (similar to tera) if needed?

I like askama's syntax better, but for flexibility reasons (e.g. updating just the response templates with the front end team) it would be awesome to have a possibility to switch whenever needed.

Thanks in advance for your support.

GuillaumeGomez commented 4 months ago

You can use askama_parser and then generate the code from there if you want?

djc commented 4 months ago

Closing this as a duplicate to #491, feel free to continue discussion there.

@GuillaumeGomez I don't see how the use of rinja_parser helps compared to using askama_parser. (This is Askama's issue tracker, not rinja's.)

GuillaumeGomez commented 4 months ago

Oh wow sorry, I meant askama_parser... Didn't pay attention to the repository.