tera v0.11.0 Release Notes
Release Date: 2018-01-22 // over 6 years ago-
๐ฅ Breaking changes
- โ
Tests parentheses are now mandatory if there are arguments (
divisibleby 2
->divisibleby(2)
) - โ Tests can be only used on variables now, not on expressions
- Escaping happens immediately now instead of waiting for the filters to be called, unless
safe
is first. If you want the old behaviour you will need to start the a chain of filters with| safe
as the first one
Others
- โ
Tests, global functions calls and macro calls are now expressions and can be combined like so:
if x is divisibleby(2) and x > 10
- โ Add default arguments for macro arguments
- โ Add whitespace management similar to Liquid and Jinja2
- โ Add parentheses to expressions to remove ambiguities
- Block & macro end tag name are no longer mandatory and it doesn't error on mismatched names between the start and end tag anymore
- Filters can now be applied to expressions
- โ Add modulo operator
%
for math expressions - ๐ Allow comment tags before the extend tag
- ๐ Make
NaiveDateTime
work with thedate
filter pluralize
filter now returns the plural suffix for 0 thing as it's apparently what English does- โ Add a
set_global
tag that allows you to set something in the global context: meant to be used in forloops where the normalset
would put the value into the loop context - Add
starting_with
,ending_with
andcontaining
tests - โ Add
json_encode
,default
andsort
filters - Strings can now also be contained in backticks and single quotes in templates
- โ
Tests parentheses are now mandatory if there are arguments (