All Versions
10
Latest Version
Avg Release Cycle
59 days
Latest Release
274 days ago

Changelog History

  • v0.8.0

    February 20, 2019

    🚀 After 3 months of development, I'm happy to announce the availability of version 0.8 of Askama, the type-safe, compiled Jinja-like template engine for Rust -- all the more so because it has taken me way too long to push out this release due to an exceedingly busy period in my personal life.

    🐎 Askama 0.8 is up to 2 times as fast as 0.7.2, thanks to performance improvements contributed by @botika and @yossyJ. For comparisons to other template engines, please look at the template benchmarks repo. The largest feature this time around is the newly added support for pluggable escape engines and formats. By adding just a few lines to the askama.toml configuration file and writing a simple implementation of the Escaper trait, Askama can use custom code for escaping, such as for different formats (LateX or shell) or with even more optimized performance (using SIMD).

    ⬆️ Upgrade notes:

    • 🏗 The use of build scripts is no longer needed and has been deprecated (#199, thanks to @de-vri-es)
    • ⬆️ Upgraded the Rocket integration to Rocket 0.4
    • Template::extension() is now a static method (#127, thanks to @ubnt-intrepid)
    • 🗄 Use of the _parent field is now deprecated (thanks to @botika)

    Other changes:

    • ⬆️ Upgraded the Rocket integration to Rocket 0.4
    • ➕ Added optional support for Gotham integration (#177, thanks to @rakenodiax)
    • ➕ Added an into_response() method for actix-web users (#205, thanks to @ZizhengTai )
    • ➕ Add support for tuple destructuring in let and for blocks (#187, thanks to @yossyJ)
    • ➕ Added optional yaml filter (#192)
    • ➕ Added an indent filter (#131, thanks to @casey)
    • ➕ Added isize and f64 filters (#146, thanks to @tizgafa)
    • ➕ Added a filesizeformat filter (#161, thanks to @tizgafa)
    • ➕ Added support for the loop.last variable (#194, thanks to @yossyJ)
    • 👍 Allow matching enum struct variants (#182, thanks to @mcarton)
    • 👍 Allow templates to work without importing Template directly (#147, thanks to @ubnt-intrepid)
    • 👍 Allow referencing self in expressions (#207)
    • 🛠 Fixed problems with unescaped expressions (#107 and #132)
    • 🛠 Fixed off-by-one error in escaping function (#138, thanks to @benjunmun)
    • Send debug output to stderr instead of stdout
    • Document assignment using {% let %} blocks
  • v0.7.2

    October 08, 2018

    🚀 After two months, I'm happy to announce the 0.7.2 release of Askama, the type-safe, compiled Jinja-like template engine for Rust! Despite the small version number increase (because this release should be fully backwards compatible with earlier 0.7 releases), there's a good amount of feature in this release. Happily, I can say that for the first time, all of the improvements in this release are due to @botika spending a lot of time on improving Askama over the past months, for which I owe them many thanks! Let's dive in:

    • 📚 Custom syntax support: in response to a bug reporter who wanted to generate LaTeX with Askama (#121), it is now possible to use custom block delimiters in your Askama templates. Read the documentation for more information on how to define and use custom syntaxes. Thanks to @botika for spending a lot of time on getting this just right.
    • ➕ Added a number of built-in filters: abs, capitalize, center and wordcount
    • 🛠 Fixed support for range-based for-loops (#117) by specializing the code generator
    • 🛠 Fixed operator precedence issues with loop attributes (like index)
    • 🛠 Fixed a number of edge cases in macro scope resolution
  • v0.7.1

    July 23, 2018

    📚 Some nice new features are now available as part of Askama 0.7.1. The most important one is the ability to search multiple directories for template files. This works by adding an askama.toml file to the crate root and specifying the search directories in there (see the documentation). Now that there is a configuration mechanism, this may unlock other potential features that rely on some way to specify out-of-band configuration.

    🚀 This release also adds optional support for actix-web. If you enable the with-actix-web feature, Template derives will include an impl for actix-web's Responder trait, so that you can trivially return template context structs from actix-web handlers.

    • ➕ Add support for multiple template directories (thanks to @mashedcode)
    • ➕ Add impl for actix-web Responder trait (thanks to @ryanmcgrath)
    • ➕ Add linebreaks and linebreaksbr filters (thanks to @Aaronepower)
    • 👍 Allow Template users to inspect template extension() (thanks to @ryanmcgrath)
    • derive(Template) is no longer restricted to named field struct types
  • v0.7.0

    June 25, 2018

    🚀 I'm excited to announce a new release of Askama, the type-safe, compiled Jinja-like template engine for Rust. Among other things, this is what actix-web uses in their TechEmpower benchmarks. Note that this release relies on Rust features first released in 1.26.0.

    🚀 The most interesting new feature in this release is an overhauled inheritance model:

    • 👍 _parent fields are no longer needed (but still supported for compatibility)
    • 👌 Supported for multi-layer inheritance has been implemented
    • Blocks can now be defined inside other blocks
    • The super() macro can be used to call parent blocks from inside a block
    • ✂ Removes the need for elaborate imports for inheritance across modules
    • 🛠 Fixes some issues with extends paths on Windows

    🚀 For this release I finally spent some time collecting benchmarks for template engines. The results can be found in this GitHub repository. I was happy to see that Askama performance seems more than competitive compared to popular alternatives.

    🚀 Smaller improvements in this release:

    • ➕ Add support for Range expressions (a..b; see #95)
    • ➕ Add support for Index operation (a[b]; see #95)
    • 👍 Allow methods to be called on self
    • ➕ Add support for loop.first variable
    • ➕ Add a simple truncate filter (see #95)
    • 🛠 Matching is more robust thanks to match binding modes (fixes #94)
    • 🔀 askama::Error is now Send + Sync + 'static
    • 🛠 Renamed lifetime on Rocket integration to prevent conflicts (fixes #88)
    • ⬆️ Upgrades to nom 4, syn 0.14 and quote 0.6

    🚀 Thanks to @Smibu and @dathinab for contributing code to this release, and to everyone else who submitted feedback for their support in further improving Askama.

    🚧 I recently started a Patreon page. If you are in a position to support ongoing maintenance and further development of Askama or use it in a for-profit context, please consider supporting my work!

  • v0.6.4

    April 30, 2018
    • ➕ Added support for unary operators ! and - (fixes #83)
  • v0.6.3

    April 30, 2018

    🛠 Fixed a regression introduced in 0.6.2 with interacting filter expressions and statements.

  • v0.6.2

    April 18, 2018

    🚀 Some great bug reports came in after the 0.6.0 and 0.6.1 releases last week, which I fixed:

    • 🛠 Fixed problems with using nested filter (or macro) calls in expressions (#78)
    • ➕ Add documentation and tests for comments, after an issue with whitespace surrounding comments was found (#79)
  • v0.6.1

    April 18, 2018

    🛠 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.

  • v0.6.0

    April 12, 2018

    📚 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.

    • Implement basic match functionality (thanks to @anowell)
    • ➕ Add support for importing template files with macros (fixes #51, thanks to @larros)
    • 🛠 Fixed implementation of Rocket Responder which was broken in the 0.5.0 release
    • Infer Content-Type from the file extension for Iron integration (thanks to @hajifkd)
    • ➕ Add support for array literals (fixes #59)
    • ➕ Add support for tuple indexing (thanks to @larros)
    • 🛠 Numerous bug fixes

    Thanks to everyone who has contributed to Askama!

  • v0.5.0

    September 07, 2017

    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.