I would like to find a better way to show the first 5 upcoming events on the homepage of our new site.
At the moment, we are
getting all of the pages in the events section
reversing them so the whole list goes from oldest (past events) to latest (future dates).
and finally only displaying the event if the event is today or in the future.
[full code is below]
Now we’d like to only show the next 5 events on the homepage and have a link to our full events on another page. And this cannot work with the existing setup — because any form of limiting I do in the range, is applied to the FULL list of events (past & present), and not just the upcoming events.
Is there a better way that I should be doing this?
I’m having bad luck getting this to work, but I am a little rusty with my Hugo skills.
I’m using the netlify/victor-hugo boilerplate, and I’ve created a folder in /content/ called shows that I have upcoming events in with the date variable set as the date of the event. In my index.html in /layouts/, I’ve put the code above (modifying ‘events’ to be ‘shows’ in my case), but nothing displays!
I checked the GSA/digitalgov.gov repository linked above, and it looks identical to what I’ve done, so maybe I’m just missing something very obvious and need a second pair of eyes.