marcoPagni
marcoPagni

Reputation: 37

'Expected end_of_string but found colon' error when chaining where filters

I've just tried to bump my Jekyll version from 3.4.3 to 3.8.5 and when I run the build, I'm getting this error:

 Liquid Warning: Liquid syntax error (line 37): Expected end_of_string but found colon in "{{site.documents | where: "belongs_to_group", page.group | where: "lang": lang | sort: "page.date" | reverse }}"

What has changed in chaining where filters? I cannot seem to find anything in the docs.

When I only include one where filter, the variable gets properly assigned.

{% assign boxes = site.documents | where: "belongs_to_group", page.group %}

As soon as I add another one, I get the said error.

Here a full example on how I was able to assign the veraiable in a previous Jekyll version.

{% assign boxes = site.documents | where: "belongs_to_group", page.group | where: "lang": lang | where_exp: "item", "item.start_datetime > site.time" | sort: "start_datetime" %}

How can I still add those filters in the new Jekyll version?

Upvotes: 0

Views: 1512

Answers (1)

Max Gardner
Max Gardner

Reputation: 301

It looks like the issue here might be in this snippet:

where: "lang": lang

The key and value should be separated by a comma (Jekyll docs).

where: "lang", lang

Your other where clause is formatted correctly, which is why it isn't throwing an error when you include only that one.

Upvotes: 2

Related Questions