Collections
Collections are Jekyll’s option for organizing items you want to handle in a consistent way.
- Use front matter defaults with layout, permalink etc.
- Sort, iterate, filter items with Liquid templating
- Assign and access custom properties in front matter with the “page” scope.
- Define a custom index page to show collection contents.
Collections can get you into trouble with regard to performance. Iterating, Filtering, etc. are happening on files not a database. Too much processing and searching will increase your total time to render the site.
Liquid
Liquid is the template language that Jekyll uses. It’s not a programming syntax, so it’s pretty verbose to do even simple things.
It was open sourced by Shopify, there are also Jekyll specific extensions.
A few common syntax conventions:
- Tags open and end:
{% for %} ... {% endfor %}
{% if %} ... {% endif %}
- Connect inputs and outputs with pipes
- Double handlebars to access variables
{% assign x = 1 | plus: 1 %}
{{ x }}