Using Jekyll to build a site, I have discrepancies between my local build and what GitHub pages renders.
I have a .html layout that uses the date
property of the page for the title:
<h1>Meeting notes - {{ page.date | date_to_string }}</h1>
and the date
is obtained thanks to the page's name YYYY-MM-DD-notes.html
.
I then use a for
loop to parse through all the meetings I have in site.meetings
and display all meeting notes after one another in a meetings.html
page.
My last two files are called: 2021-12-07-notes.html
and 2022-01-18-notes.html
so the first two titles in my meetings page should be:
Meeting notes - 18 Jan 2022
Meeting notes - 07 Dec 2021
Which is indeed what I get in my local build (along with all the previous ones, first meeting being in 2019).
But what GitHub pages renders is:
Meeting notes -
Meeting notes - 07 Dec 2021
As if he couldn't 'see' the 2022 date. Still working fine with all previous dates btw and again, on the local build.
Could someone explain this weird behavior?
Ok this was simply because I didn't have the right file name.
The file was actually called 2022-01-18_notes.md
and not 2022-01-18-notes.md
which made GitHub pages not recognise the date. Apparently my local jekyll is a bit more tolerant.