Variables
Variable tags create new Liquid variables. Here are the two most common tags but you can learn more in the official documentation.
assign
Read the complete assign documentation.
Creates a new named variable.
{% assign foo = "bar" %}
{{foo}}barcapture
Read the complete capture documentation.
Captures the string inside of the opening and closing tags and assigns it to a variable. Variables created using capture are stored as strings.
{% assign favorite_food = "pizza" %}
{% assign age = 35 %}
{% capture about_me %}
I am {{age}} and my favorite food is {{favorite_food}}.
{% endcapture %}
{{about_me}}Last updated
Was this helpful?
