Skip to main

Utility Filters

src/filters/utils.js

Inspect

typeCheck()

Return either the type, or the result of a type-check.

Params:

  • val {any}

    The data to check

  • is {string} = undefined

    Optionally check for a particular type

Example:

{{ my_data | typeCheck('array') }}

Formatting

styles()

Convert an object of property-value pairs into valid CSS for an inline-style.

Params:

  • dict {object}

    CSS property-value pairs

Example:

<div style="{{ style_dict | styles }}">

Filter

onlyShow()

Return only the first n items in a collection.

Params:

  • dict {object}

    CSS property-value pairs

oddNewsTags()

Returns the matching mailchimp form tag for the page where the signup form lives |

Params:

  • name {string}

    name of page such as ‘footer’

See Also