From 058dc2021d0e97b47250877df46d29ef404897f5 Mon Sep 17 00:00:00 2001 From: Sergei Filippov Date: Tue, 24 Jan 2017 14:29:14 +1300 Subject: [PATCH] Added a use case example for capture tag --- tags/variable.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tags/variable.md b/tags/variable.md index 16ca9d5..456d8f7 100644 --- a/tags/variable.md +++ b/tags/variable.md @@ -55,6 +55,24 @@ Captures the string inside of the opening and closing tags and assigns it to a v ```text I am being captured. ``` +Using `capture`, you can create complex strings using other variables created with `assign`. + +

Input

+```text +{% assign favorite_food = 'pizza' %} +{% assign age = 35 %} + +{% capture about_me %} +I am {{ age }} and my favorite food is {{ favorite_food }}. +{% endcapture %} + +{{ about_me }} +``` + +

Output

+```text +I am 35 and my favourite food is pizza. +``` ## increment