Filters

json

value | json

Serialises a value as JSON, for embedding in a script tag or a data attribute.

Example

<script type="application/json">{{ section.settings | json }}</script>