Looking into a templating engine for #Rust. Preferably #jinja2 like. https://github.com/Keats/tera is an option, but does anyone have any suggestions? #rustlang
GitHub - Keats/tera: A template engine for Rust based on Jinja2/Django

A template engine for Rust based on Jinja2/Django. Contribute to Keats/tera development by creating an account on GitHub.

GitHub
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
GitHub - djc/askama: Type-safe, compiled Jinja-like templates for Rust

Type-safe, compiled Jinja-like templates for Rust. Contribute to djc/askama development by creating an account on GitHub.

GitHub

@agnew_hawk @daubers I would recommend Askama if you want to return templates from a server because the templates are compiled and checked at compile time.

If you want to use templating to build something once before serving it (like with a static site generators), then I would recommend Tera. The static site generator Zola uses it. It is more flexible and you will see errors on building the site anyway.

GitHub - mitsuhiko/minijinja: MiniJinja is a powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2

MiniJinja is a powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2 - mitsuhiko/minijinja

GitHub
@tranzystorek_io @daubers This is the answer. It’s from the author of Jinja.
@tamas @tranzystorek_io oh win. I'll have a read. Thank you
@daubers I've used askama on a few projects and it's pretty good

@daubers
If I might self-suggest ... https://lib.rs/crates/ructe might be worth a look.

To be honest, it doesn't really look like jinja, the major design difference is that ructe converts your templates to code at compile-time. That makes it efficient and it avoids runtime template errors (but makes it impossible to change tempates at runtime).

ructe

Rust Compiled Templates, efficient type-safe web page templates

Lib.rs