SteGriff

Blog

Next & Previous

Chained Filters in Jekyll Liquid

As far as I can tell, you canโ€™t do consecutive/chained filters in Liquid for Jekyll, instead you should do multiple assigns.

I had something like this:

{% for pebble in pebbles | sort: "updatedAt" | reverse %}

Which gives a build warning:

Liquid Warning: Liquid syntax error (line 18): Expected end_of_string but found pipe in "pebble in pebbles | sort: "name" | reverse" in pebbles.md

Instead you have to do a few reassignments to put the array in the right shape:

{% assign pebbles = pebbles | sort: "updatedAt" %}
{% assign pebbles = pebbles | reverse %}
{% for pebble in pebbles %}

So, now you know! ๐Ÿ›‹