Modifier: to_json


Converts any variable into JSON.

stats:
  - player: Luke Skywalker
    score: 750
  - player: Wedge Antilles
    score: 688
  - player: Jar Jar Binks
    score: 1425
{{ stats | to_json }}
[
  {"player":"Luke Skywalker","score":750},
  {"player":"Wedge Antilles","score":688},
  {"player":"Jar Jar Binks","score":1425}
]

Additional Reading

Learn how to use and chain modifiers in the Antlers template guide.

Last modified on May 24, 2018