config.js:
config.js
delimiters
Array containing beginning and ending delimiters for expressions.It’s common for templating engines (like those used by email service providers) to use
{{ and }} as delimiters. You may change the ones Maizzle uses in order to avoid conflicts:config.js
unescapeDelimiters
Array containing beginning and ending delimiters for unescaped locals.You’d normally use these when you want to output HTML from a variable without escaping it:Result:
locals
Variables defined here will be available ‘locally’, meaning you won’t need to use the
page object when accessing them.For example, if you set this to something like {foo: 'bar'}, you can access it in your templates through {{ foo }} instead of {{ page.foo }}.localsAttr
Attribute name for Then, you’d use it like this:
<script> tags that contain locals.Imagine you’d write <script vars> instead of <script locals> to define variables in your templates. You can change the attribute name like this:config.js
example.html
removeScriptLocals
Whether to remove
<script> tags that contain locals.conditionalTags
Array containing tag names to be used for if/else statements.
switchTags
Array containing tag names to be used for switch statements.
loopTags
scopeTags
ignoredTag
Name of tag inside of which expression parsing is disabled.Besides
{{ }} expressions, the following tags will be ignored and output as-is:- conditional tags (if/elseif/else)
- switch tags (switch/case/default)
- loop tags (each/for)
- scope tags (scope)
strictMode
Maizzle disables
strictMode so that if you have an error inside an expression, it will be rendered as undefined and the email will still be compiled, instead of the build failing.missingLocal
Define what to render when referencing a value that is not defined in
By default, Maizzle will output the string the original reference as a string, i.e.
locals.| missingLocal | strictMode | Output |
|---|---|---|
undefined | true | Error is thrown |
undefined | false | undefined (string) |
'' | false/true | '' (empty string) |
{local} | false/true | Original reference like {{ foo }} |
{{ foo }}, when a value is not defined.