Github Pages Date Issue

I have added a new tab to my website called" teaching", and I have noticed that the date field is not showing up as it does on other pages. It looks like this( , , 2020). I have added it to navigation.yml, _config.yml and created a teaching.html in _pages.

Could it be I have failed to configure something?

*My repo is: https://github.com/angelabaltes/angelabaltes.github.io

*and my github pages site is: https://angelabaltes.com/teaching/

I would most appreciate your help. It has to be something minor that I have overlooked.

Hello. :wave:

I forked the site and experimented a bit, I found the issue is in _includes/archive-single.html at line 42 when its formatting the year, it’s expecting a post.type and post.venue which aren’t in the .md files, causing only , , 2020 to be displayed, to just display the date you can replace the line with this:

<p> <time datetime="{{ post.date | default: "1900-01-01" | date_to_xmlschema }}">{{ post.date | default: "1900-01-01" | date: "%B %d, %Y" }}</time> </p>

Which is a piece taken from line 46 in the same file (_includes/archive-single.html) - displaying the month, day and year, or you could add the post.type and post.venue to the .md file meta.

I hope that helps you. :slightly_smiling_face:

2 Likes

This was incredibly helpful! Thank you!

1 Like