Liquid uses a combination of objects, tags, and filters inside template files to display dynamic content.
ObjectsObjects contain the content that Liquid displays on a page. Objects and variables are displayed when enclosed in double curly braces: {{
and }}
.
Input
Output
In this case, Liquid is rendering the content of the title
property of the page
object, which contains the text Introduction
.
Tags create the logic and control flow for templates. The curly brace percentage delimiters {%
and %}
and the text that they surround do not produce any visible output when the template is rendered. This lets you assign variables and create conditions or loops without showing any of the Liquid logic on the page.
Input
{% if user %}
Hello {{ user.name }}!
{% endif %}
Output
Tags can be categorized into various types:
You can read more about each type of tag in their respective sections.
FiltersFilters change the output of a Liquid object or variable. They are used within double curly braces {{ }}
and variable assignment, and are separated by a pipe character |
.
Input
{{ "/my/fancy/url" | append: ".html" }}
Output
Multiple filters can be used on one output, and are applied from left to right.
Input
{{ "adam!" | capitalize | prepend: "Hello " }}
Output
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4