Liquid is a template engine for HTML. It’s used by Jekyll.
Variables Usage
- Declaration in a
config.yml
file withhome_sidebar: Home
- Usage with
liquid
infile.html
as{{ site.home_sidebar }}
Functions
Show liquid code snippets
When writing liquid
code snippets, jekyll process this code instead of showing it. To solve this, wrap the code snippet with the tags
{percent raw percent}
{percent endraw percent}
Structures
if
{% if p.layout == 'page' and p.order == current_index %}
// do thing
{% endif %}
for loop
{% for p in site.pages %}
// do thing
{% endfor %}