capture tag
capture tag
Section titled βcapture tagβ- The Capture tag sets the value of a named variable by rendering the content with the tagβs block.
Example: {% raw %}
{% assign favorite_food = "pizza" %}
{% assign age = 35 %}
{% capture about_me %}
I am {{ age }} and my favorite food is {{ favorite_food }}.
{% endcapture %}
{{ about_me }}{% endraw %} Output:
I am 35 and my favorite food is pizza.