LiquiDoc CMF administrators will likely spend considerable time wading through Liquid template files, either to generate (1) layout, structural, and metadata elements of the website or (2) iterative elements of the content (prebuilding). In each case, templating serves the purpose of mixing small data and tokenized markup, substituting parameterized data for embedded tokens.

Liquid is a fairly light, tag-based markup format that enables conditional flows, iteration/looping, and powerful variable substitution.

Example — Conditionally looping variables in Liquid
{% for p in pages %}
{% if p.categories contains "tutorials" %}
<li><a href="{{ p.url }}">{{ p.title }}</a></li>
{% endif %}
{% endfor %}

We’ll delve deeper into Liquid later on (see Theming Jekyll with Liquid), but it is probably already becoming clear that we need to get all these different kinds of variables under control.

Tags: