Skip to content
Daniel Lohse edited this page Jul 31, 2016 · 23 revisions

What is Jet?

Jet is a template engine that was designed to be easy to use and fast.

  • simple and familiar syntax
  • easy to use
  • dynamic
  • fast and light
  • useful error messages
  • template inheritance
  • powerful

Simple and familiar syntax

The syntax has many similarities with Go's text/template templating language. The main differences are:

  • support for template inheritance
  • simple C-like expressions
  • pipelines can only be used in actions (i.e. {{ expression|pipe|pipe }})
  • all templates are file based – there are no "define", "template" or "with" actions

Dynamic

Templates can extend a template (known as a layout) and import blocks from another and everything just works, that way you can create a template library, layout templates and the application templates.

Fast and light

The engine was designed to be fast and light by avoiding unnecessary allocations and a fast runtime.

Useful error messages

All error messages are tied to the file and line of the node executing the action or expression, and all message are descriptive so you know exactly what's wrong.

Template inheritance

In Jet you can extend, import and include templates:

  • when extending, all blocks from the template that you extend will be available for your template even the ones that it imports or extends, also the root of the extended template is used as the entry point when executing
  • when importing a template, all blocks of the imported template will be available in your template
  • When including a template, the template will be invoked and all blocks available in your template will be available in the included template
Clone this wiki locally