101591 Views
79842 Views
45596 Views
44332 Views
40991 Views
33419 Views
Raspberry Pi Time machine
Now Ad-Free
Guiding Light
Sync Files on your Pis, with Syncthing
NextCloud
Buddy Jr.
Introduction to FreeCAD for Beginners
Building a Robot Arm with Raspberry Pi and PCA9685
Building User Authentication for Static Sites with FastAPI
Mastering Pydantic for Robust Data Validation
Mastering Markdown for Documentation with Jekyll
Introduction to Rust
KevsRobots Learning Platform
70% Percent Complete
By Kevin McAleer, 2 Minutes
Liquid is a templating language used by Jekyll to process templates. It allows you to add dynamic content, use variables, and implement logic in your site’s pages and posts. Understanding Liquid is essential for maximizing the power of Jekyll as a static site generator.
Liquid syntax is simple and consists of objects, tags, and filters:
{{ }}
{% %}
{{ 'data' | filter }}
You can use objects to display data from your site’s configuration file (_config.yml), front matter, or page content:
_config.yml
{{ site.title }} {{ page.author }}
Tags allow you to implement control flow statements like if, else, elsif, and loops using for.
if
else
elsif
for
{% if page.title %}
{% else %}
{% endif %}
To iterate over a list of items, such as posts:
{% for post in site.posts %}
{{ post.excerpt }}
{% endfor %}
Filters allow you to modify the output of objects for formatting or transforming data:
This filter changes the string to uppercase.
< Previous Next >