Simplified Introdction page Spiced up home page more, style changes to code examples
1.4 KiB
title
| title |
|---|
| Introduction |
Liquid code can be categorized into three parts: objects, tags, and filters.
Objects
Objects tell Liquid where to show content on a page. Objects and variable names are denoted by double curly braces: {% raw %}{{{% endraw %} and {% raw %}}}{% endraw %}.
{% raw %}
{{ page.title }}
{% endraw %}
Introduction
In this case, Liquid is rendering the content of an object called page.title, and that object contains the text Introduction.
Tags
Tags create the logic and control flow for your templates. They are denoted by curly braces and percent signs: {% raw %}{%{% endraw %} and {% raw %}%}{% endraw %}.
Tag markup does not resolve to text. This means that you can assign variables and create conditionals and loops without showing any of the Liquid logic on the page.
{% raw %}
{% if user %}
Hello {{ user.name }}!
{% endif %}
{% endraw %}
Hello Adam!
Tags can be categorized into three types:
You can read more about each type of tag in their respective sections.
Filters
Filters modify the output of a Liquid object. They are using within an output and are separated by a |.
{% raw %}
{{ "/my/fancy/url" | append: ".html" }}
{% endraw %}
{{ "/my/fancy/url" | append: ".html" }}