Date stamp in page name causing issues with if loop


#1

Hey guys,

My site is a design portfolio and I have a handful of pages for projects that are date stamped in 2017…and then I have a recent page where the date stamp starts with 2018…

At the bottom of each project page I have buttons to navigate to the previous project or the next project, but for whatever reason…jekyll is only looping through the 2017 pages and ignoring the one with 2018…

My guess is I don’t have something configured or called out properly…but I’m stalled out on where to go from here. Here are the two if loops:

Previous page:
{% if page.next and page.next.categories contains “work” %}

Previous Project


{{page.next.client.name}}

{% endif %}

Next Page:
{% if page.previous and page.previous.categories contains “work” %}

Next Project


{{page.previous.client.name}}

{% endif %}

If i change the date stamp for the 2018 page to 2017…then it appears as expected…

What needs to change?


#2

is there a repo to look at?


#3

No repo exactly. I only have the URL to share.


#4

are you using the paginator? 2018 pages are posts or pages? are they in the same directory as the 2017 ones?

probably going to be hard to trouble shoot this without a repo to look out.


#5

Each page is a markdown file inside one _posts subfolder.

Each is named YYYY-MM-DD-Page-title.md

I haven’t set any additional pagination settings, just using default Jekyll as it was installed


#6

@lambiam Can you post the contents of the front matter block of the 2018-document, at least…?