What does {% capture var %} do in jekyll? -


what {% capture var %} in jekyll?

can example, in .md file do:

{% capture head %} head {% endcapture %} 

and in .html file do:

{{head}} 

am using capture correctly? sorry, couldn't find documentation on capture.

capture lets assign text variable name. later on when referencing variable can output text.

in above example head variable name. you're saying, place of text between opening , closing capture tags in variable named head.

then later in {{head}} you're saying you'd dump contents of variable onto page. there nothing special name head , rename else entirely.

you can find more information capture on liquid designers page


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -