Developing Themes

Liquid

Liquid is an open-source templating language that was developed by Shopify. It uses tags, objects, and filters to render out content into a theme.

For an in-depth Liquid reference, check out the official Liquid documentation.

Tags

A tag is a piece of logic that will tell the templating engine what to do. This includes operations like if, for, foreach, and capture. For example:

{% if page.title == 'Home' %}
  Do something if condition is true
{% else %}
  Do something if condition is false
{% endif %}

Note that each tag is ended with the same tag, prepended with end.

Objects

An object is a piece of data that has attributes with content. An object can be your site, a post, a set of posts, and so on. For example:

{{ page.title }}

Filters

Filters are used to modify the output of attributes (i.e., strings, numbers, variables, and objects):

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

Further Reading

Help improve this page