Type-safe, compiled Jinja-like templates for Rust
Some great bug reports came in after the 0.6.0 and 0.6.1 releases last week, which I fixed:
This is a quick bugfix release for #73: due to an unsupported way of including syn, Askama had a run-time dependency on proc-macro, which didn't work well in some scenarios. Thanks to @dtolnay for the bug fix.
Finally, another release of Askama, the type-safe compiled Jinja-like Rust templating library. The biggest feature in this release is the support for match
blocks, making it possible to do pattern matching in templates. An example is provided in the documentation.
Responder
which was broken in the 0.5.0 releaseThanks to everyone who has contributed to Askama!
Discussing the 0.4.0 release made me think I should quickly make one further change: inferring the escape mode from the template path
, or a specified extension if you're using the source
attribute. This means escaping is now only on by default for templates with a html
, htm
, or xml
extension. In addition, this release escapes more characters, according to the OWASP recommendations.
If you spent time making changes for the 0.4.0 upgrade already, sorry about the churn! I believe this minimizes boilerplate and hopefully doesn't introduce too much magic.
Roughly six months after announcing the first public version of Askama, 0.4.0 feels like a large update.
There are some breaking changes compared to the 0.3.0 series:
&
, <
and >
are replaced with HTML character entities by default (see #23)Error
and Result
typesOther noteworthy new features include:
_parent
to refer to fields from the parent contextTemplate
implementations now automatically implement Display
Special thanks to those who have contributed to this release, in particular @anowell and @defyrlt.
Please post your feedback or questions as an issue or join the chat!
use std;
or use askama;
in template modules (#17)lower
, trim
and upper
filters (#16, #19)askama_derive
crate usage inside askama
, making it easier to use (#2)Iterator
variants in for loops (#8)