Hi I'm working on a Jekyll site. I am using a capture cycle for odd and even displays of the collection. I would also like to specifically target which collections are shown on this page.
Here's the code so far:
{% assign sorted = (site.catalog | sort: 'date') | reverse %}
{% for project in sorted limit: 5 reversed %}
{% capture thecycle %}{% cycle 'odd', 'even' %}{% endcapture %}
{% if thecycle == 'odd' %}
{% if project.featured == "1" || project.featured == "3" || project.featured == "5" %}
<div>{{ project.title }} {{ project.subtitle }}</div>
{% endif %}
{% if thecycle == 'even' %}
<div>{{ project.title }} {{ project.subtitle }}</div>
{% endif %}
{% endfor %}
So I would like five items to be shown on this page in total. For the odd cycles, I would like those items to be (1,3,5) to display a certain format, and for the even cycles, I would like those items (2,4) to display a certain format.
The approach I started using would show this variable in the front matter of the collection item:
featured: "1"
Thanks in advance for any help