Improving where filters in Jekyll
where filter selects items from arrays so you don’t have to loop through an entire set. In Jekyll this is useful for creating things like category listings, as well as cutting down on site build times.
So you might output a list of all posts in the
web category like this:
That’s good, if a little restrictive.
where only lets you filter for conditions where something equals something else (in this case where the category equals web).
There are times when you might want to filter for all articles not in the
web category. For this, you need the
where_exp lets you use expressions and operators in filters, such as
!=, so you could also use it to filter for all posts in the
libraries categories. Here’s how you filter for everything not in the
Add a comment