Releases: CloudyKit/jet
v5.0.0
With version 5, Jet gets Go-like discard syntax (_ := stillRuns()
, #168) and allows you to specify the argument slot of the piped value when pipelining (2 | repeat("foo", _)
, #169).
This means that _
is now a reserved symbol, as noted in v5's breaking changes: https://github.com/CloudyKit/jet/blob/master/docs/changes.md#v5.
v4.1.0
Allows concatenating string and []byte.
This is useful for using the return value of the built-in json() function, for example:
{{ "{foo:"+json("asd")+"}" }}
This would previously render as {foo:[34 97 115 100 34]}
but will now render as {foo:"asd"}
).
v4.0.2
Fixes absolute path detection on Windows.
v4.0.1
Allows using parentheses syntax for function calls in pipelines, for example "foo" | repeat(2) | upper
is now valid, when only "foo" | repeat: 2 | upper
would work previously.
v4.0.0
Version 4 brings a lot of bug fixes and improvements as well as updated documentation, but make sure to read through the breaking changes before making the jump.
Feel free to update and report any bugs (or undocumented breaking changes). I'm quite sure this release won't be perfect since there went a lot of work into it and the tests still leave a lot to be desired (and also because it's my first release).
Minor behind the scenes improvements
v2.1.1
v2.1.0
v2.0.1
- fixed negative numbers in the template throwing an error – this happened, for example, when using
{{ replace("My Name Is", " ", "_", -1) }}
which would error (the last parameter of Go'sreplace
function denotes the maximum number of replacements to perform, -1 being unlimited) – fixed in fd3b9c0 - added
{{ includeIfExists(templateName) }}
function that doesn't throw an error if the template to include doesn't exist (useful for dynamic template files to include); it also has a second form where you can use the boolean return value to print something else if the template couldn't be found – documented here, added in 9a0ef3b
Release v2.0
- much more powerful
{{block}}
and{{yield}}
constructs, allowing local variables, default variables as well as wrapping (read more) - fast functions that are up to 50% faster than normal functions; the built-in
len
andisset
functions are implemented as fast functions (read more in the new Advanced section) - simple string concatenation in templates obviate the need for
sprintf
-like functions:{{ "build."+someString+".your-string" }}
(see here) isset
can now be used to check for the existence of a key in a map (works both with the var map as well as the context, see here and here)- templates can now also be imported/included relatively and without the extension; provided the templates' filenames end with
.jet
,.html.jet
or.jet.html
(read more)