I can't figure out what's going wrong here, I have several other pieces of code with the same structure yet they don't return this error.
Here is the liquid code within the HTML file (item.html) that I'm having trouble with:
{% assign item-collection = site.item-collection | sort: 'date' | reverse %}
{% for item in item-collection %}
{% if item.featured == true limit: 3 %}
<div class="item">
</div>
{% endif %}
{% endfor %}
Here's an 'item' (item.md) being processed;
---
layout: item
date: 2017-06-08 00:00:00
title: item 1
featured: true
tags:
---
Here's the error returned by Terminal:
Regenerating: 1 file(s) changed at 2017-06-28 22:41:16 Liquid Warning: Liquid syntax error (line 30): Expected end_of_string but found id in "item.featured == true limit: 3" in /_layouts/item.html ...done in 1.337976 seconds.
If I leave the date empty this error doesn't occur, but as soon as something is entered this error stops the site from being built.
The error also disappears if i remove the 'limit: 3' from the liquid code, but I need this limit in place.
Any ideas on what I'm doing wrong? Thanks in advance!