Skip to main content
Version: 2.X

Templates

Templates are used all along the process, they are present in the variables values, in the cast properties (e.g. to, from, etc.). Templates are rendered using the Go text/template engine.

caution

Caveat: Despite of other template engines such as handlebars, jinja or mustache, the Go template engine need to refer variables with a dot prefix. For example, to refer to the project_name variable, you need to use .project_name.

Golang template engine allows to use if-else statements and loops. See more about control structures in the text/template documentation. In addition, helper functions can be used in the templates to transform and manipulate variables. See more about helper functions in the Helper Functions section.

For further information about the Go template engine, please refer to the official documentation.

Example

casts:
- from: |
# {{ .project_name }}
to: "{{ .project_name }}.md"
variables:
- name: project_name
value: My Project