JSON variables

A single object can be passed to a snippet by using the with...as syntax.

output

Title: When the sun goes down

Content: That's when the fun begins

Author: Mickael Jackson

input

{% render 'components/card' with single-object as item %}

card.liquid

<article>
    <h4>{{ item.title }}</h4>
    <p>{{ item.content}}</p>
    <p>{{ item.author }}</p>
</article>

single-object.json

{
    "title": "When the sun goes down",
    "content": "That's when the fun begins",
    "author": "Mickael Jackson"
}