/ Developers

Helper functions

Blot exposes some general purpose functions across your template.

The contents inside the tagis replaced with…
{{#absoluteURLs}} ... {{/absoluteURLs}}The same contents, with any relative URLs fully resolved. This is useful to create an RSS feed, since many clients struggle with relative URLs. For example:

1
2
{{#absoluteURLs}} {{{html}}} {{/absoluteURLs}}

{{#encodeJSON}} ... {{/encodeJSON}}The same contents, encoded appropriately for JSON. This is useful to create a JSON feed. You can use it like this:

1
2
html: "{{#encodeJSON}} {{{html}}} {{/encodeJSON}}"

{{#encodeURIComponent}} ... {{/encodeURIComponent}}The same contents, encoded appropriately for a URI component