Yoolk Liquid

Home Basics

Introduction

Liquid is an open-source, Ruby-based template language created by Shopify. Yoolk uses this template language to allow external people to build Instant Website Theme.

<ul id="products">
  {% for product in products %}
    <li>
      <h2>{{ product.name }}</h2>
      Only {{ product.price | number_to_currency }}

      {{ product.description | simple_format }}
    </li>
  {% endfor %}
</ul>

Liquid uses a combination of tags, objects, and filters to load dynamic content. They are used inside Liquid template files, which are a group of files that make up a theme. For more information on the available templates, please see Theme Development.

Tags

Tags make up the programming logic that tells templates what to do.

{% if user.name == 'elvis' %}
  Hey Elvis
{% endif %}

read more »

Objects

Objects contain attributes that are used to display dynamic content on the page.

{{ product.name }}
<!-- Output: Awesome T-Shirt-->

read more »

Filters

Filters are used to modify the output of strings, numbers, variables, and objects.

{{ 'sales' | append: '.jpg' }}
<!-- Output: sales.jpg -->

read more »