Skip to main content

Template Language

Plain text

Plain text is copied over to the output as-is.

Template
Hello, world!
Variables
{}
Output
Hello, world!
Edit the template or variables to see the output change.

Variables

Add {{ variableName }} to templates. These will be replaced with the value of the variable.

Template
Hello, {{name}}!
Variables
{
    "name": "Alan Turing"
}
Output
Hello, Alan Turing!
Edit the template or variables to see the output change.

Missing variables

If a variable is missing, it will be replaced with the word undefined. If you'd like it to be replaced with something else, you can set missingVariableDefault in the options.

Comments

If you need to put comments in your blocks, you can do so with the {# comment #} syntax.

Template
Who else is attending {# school name #}{{ place }}?
Variables
{
    "place": "OSU"
}
Output
Who else is attending OSU?
Edit the template or variables to see the output change.

Escaping

If you need to include the characters {{ or }} in your output, you can escape them with a backslash.

Template
microfern uses \{{ blocks \}} for placeholders.
Variables
{}
Output
microfern uses {{ blocks }} for placeholders.
Edit the template or variables to see the output change.