--- url: https://docs.youcan.shop/themes/tags/capture.md --- # `capture` Captures the output inside a block and assigns it to a variable **Example:** ```liquid {% assign brand = 'YouCan' %} {% capture foo %}Hello from {{- brand -}}{% endcapture %} {{ foo }} ``` ::: tip Output ```html Hello from YouCan ``` :::