tera
A template engine for Rust based on Jinja2/Django
2.2.0
36M downloads/mo
#1500 most downloaded on crates.io
Keats/tera
What this package is like to depend on
Last release 3 days ago
20 Aug 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 76 of 80 stable releases
6 versions withdrawn
withdrawn after publishing
10 years old
126 releases · first in 2016
14 releases in the last 12 months
see the full history below
Release timeline
126 releases · Apr 2016 to Aug 2026Releases
latest 60 of 126-
2.2.020 Aug 2026Release notes
Open source →- Do not reserialize existing Value when serializing to a Value
- Error on content in children templates that would have been ignored
- Allows blocks inside if/elif/else again like in v1
- Allows the indentation character of the
indentfilter to be configured - Add chained filter sections
-
2.1.111 Aug 2026Release notes
Open source →- Fix component default value not allowing negative numbers
- Fix component default value not checking whether default value matches expected type
-
2.1.023 Jul 2026Release notes
Open source →- Add .iter() method to Kwargs
- Add
Tera::contains_componentandTera::get_component_names
-
2.0.026 Jun 2026 -
2.0.0-alpha.920 Jun 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.817 Jun 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.705 Jun 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.620 May 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.511 May 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.430 Apr 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.323 Apr 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.203 Mar 2026 pre-releaseNothing published for this version
-
2.0.0-alpha.103 Feb 2026 pre-releaseNothing published for this version
-
1.20.130 Oct 2025Nothing published for this version
-
1.20.027 May 2024Release notes
Open source →- Support parenthesis in if statements
- Allow escaped newline and tab join separator
-
1.19.103 Sep 2023Release notes
Open source →- Minimum supported Rust version (MSRV) is now 1.63 due to transitive dependencies.
- Update crates.io metadata for the website
-
1.19.031 May 2023Release notes
Open source →- Revert change to glob path to not error if the path doesn't exist
- Allow macro definition in renderable template
-
1.18.115 Mar 2023 -
1.18.008 Mar 2023Release notes
Open source →- Add
absfilter - Add
indentfilter - Deprecate
get_json_pointerin favour ofdotted_pointer, a faster alternative - Always canonicalize glob paths passed to Tera to workaround a globwalk bug
- Handle apostrophes in title case filter
- Some performance improvement
- Add
-
1.17.119 Sep 2022Release notes
Open source →- Make
get_randomuse isize instead of i32 and bad error message - Fix variables lookup when the evaluated key has a
.or quotes - Fix changed output of f64 from serde_json 1.0.85
- Make
-
1.17.014 Aug 2022Release notes
Open source →- Fix bug where operands in
inoperation were escaped before comparison - Force chrono dep to be 0.4.20 minimum
- Better support for parenthesis in expression
- Fix bug where operands in
-
1.16.010 Jun 2022Release notes
Open source →- Add a feature just for the urlencode builtin
- Fix bug in slice filter if start >= end
- Allow supplying a timezone to a timestamp for the date filter
-
1.15.003 Nov 2021Release notes
Open source →- Add
defaultparameter togetfilter Tera::extendnow also copies over function- Remove the new Context-local Tera function support, it was an accidental breaking change and will be added in v2 in some ways instead
- Add
-
1.14.001 Nov 2021 withdrawnRelease notes
Open source →- Ensure
Contextstays valid in Sync+Send, fixing an issue introduced in 1.13. 1.113 will be yanked.
- Ensure
-
1.13.017 Oct 2021 withdrawnRelease notes
Open source →- Add
defaultparameter togetfilter Tera::extendnow also copies over function- Add Context-local Tera functions
- Add
-
1.12.113 Jul 2021Release notes
Open source →- Remove unused feature of chrono
- Remove unwanted bloat in crate from accidental WASM files
-
1.12.029 Jun 2021 -
1.11.014 Jun 2021 -
1.10.021 May 2021 -
1.9.016 May 2021 -
1.8.021 Apr 2021Release notes
Open source →- Add
linebreaksbrfilter from Django - Allow dots in context object key names
- Add
-
1.7.112 Apr 2021 -
1.7.007 Mar 2021Release notes
Open source →- Allow rendering to
std::io::Write - Follow symlinks in glob
- Allow including lists of templates
- Comment tags can now use whitespace control
- Allow rendering to
-
1.6.129 Dec 2020 -
1.6.019 Dec 2020Release notes
Open source →- Allow multiline function kwargs with trailing comma
- Add
Context::try_insert
-
1.5.010 Aug 2020Release notes
Open source →- Add the concept of safe functions and filters
- Allow negative index on
slicefilter
-
1.4.024 Jul 2020 -
1.3.109 Jun 2020Release notes
Open source →- Fix
rawtag swallowing all whitespace at beginning and end - Make batch template sources generic
- Automatically add function/test/filter function name to their error message
- Fix
-
1.3.016 May 2020Release notes
Open source →- Add a
urlencode_strictfilter - Add more array literals feature in templates
- Make
filterfilter value argument optional
- Add a
-
1.2.029 Mar 2020Release notes
Open source →- Add
trim_start,trim_end,trim_start_matchesandtrim_end_matchesfilters - Allow blocks in filter sections
- Add
-
1.1.008 Mar 2020Release notes
Open source →- Add Tera::render_str, like Tera::one_off but can use an existing Tera instance
-
1.0.213 Jan 2020Release notes
Open source →- Length filter now errors for things other than array, objects and strings. The fact that it was returning 0 before for other types was something that should have been fixed before 1.0 but got forgotten and was considered a bug.
-
1.0.118 Dec 2019Release notes
Open source →- Fix filter sections not keeping whitespaces
- The filesizeformat filter now takes a usize instead of a i64: no changes to behaviour
-
1.0.007 Dec 2019Release notes
Open source →Breaking changes
- Now requires Rust 1.34
- Removed error-chain errors and added rich Error enum instead
- Filter, Tester and Function are now traits and now take borrowed values instead of owned
- Updated for 2018 edition
- Require macros import to be at the top of the files along with
extendsas it is fairly cheap and the code already only really look there. - Enforce spacing in tags at the parser, before
ifsomethingwas considered ok - Pluralize filter now uses
singularandpluralarguments instead ofsuffix - Add a test for checking whether a variable is an object
- Escaping now happens before inserting the final result of an expression: no need anymore to add
| safeeverywhere, only at the last position - Remove
safeargument of the urlencode filter,/is still escaped by default - The
compile_templates!macro has been removed
Others
- Tests can now use
value is not definedorder for negation (https://github.com/Keats/tera/issues/308) - Add
nthfilter to get the nth value in an array - You can now use glob patterns in
Tera::new defaultfilter now works on Null values- Literal numbers in template overflowing i64/f64 will now be an error instead of panicking
- Allow arrays as test arguments
- Add the
inoperator to check if a left operand is contained in a right one. Also supports negation asnot in - Add
Context::from_valueto instantiate aContextfrom a serde_jsonValue - Add
Context::from_serializeto instantiate aContextfrom something that implSerialize - Make tests helper fns
number_args_allowed,value_definedandextract_stringpublic - Add
elseclause to for loops - Filters are now evaluated when checking if/elif conditions
- Allow
{{-and-}}for whitespace management - Add
xml_escapefilter - Grave accent is no longer escaped in HTML, it is not really needed anymore
- Add a
builtinsdefault feature that gate all filters/functions requiring additional dependencies - Add
uniqueandmapfilter - Add a
timezoneattribute to thedatefilter - Add a
get_randomfunction to get a random number in a range - Add a
get_envfunction to get the value of an environment variable
-
1.0.0-beta.2101 Dec 2019 pre-releaseNothing published for this version
-
1.0.0-beta.2026 Nov 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1930 Oct 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1820 Oct 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1717 Oct 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1625 Sep 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1516 Sep 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1415 Aug 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1315 Jul 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1212 Jul 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1106 Jul 2019 pre-releaseNothing published for this version
-
1.0.0-beta.1016 Jun 2019 pre-releaseNothing published for this version
-
1.0.0-beta.910 Jun 2019 pre-releaseNothing published for this version
-
1.0.0-beta.801 Jun 2019 pre-releaseNothing published for this version
-
1.0.0-beta.729 May 2019 pre-releaseNothing published for this version
-
1.0.0-beta.620 May 2019 pre-releaseNothing published for this version