Event Listing - future dates only

Trying to figure out some ways to work on an event listing site that only shows upcoming dates. Just wondering what strategies others would use to ensure the list is always up to date?

Rebuild the site daily?
Using JS to pull in event data from a separate location?
Outputting all event data into the page to be parsed/output through JS?

The only event related stuff I could find on here was pretty static.

I would have gone with the simplest: Rebuild at intervals.

1 Like

I’ve thought of this scenario, and I agree with bep. Further, I would keep the changes to files at a minimum, and would deploy with rsync or similar. Then, only the the front/event category pages need to change, and perhaps a partial to show an event has passed.

That way there are less pages to update on each build. I’d probably run the build twice a day.

I’ve done it both ways, and prefer the rebuild option as well. For rebuilds you can use Zapier or IFTTT with webhooks to rebuild your site automatically at whatever interval suits your data. Or, you can also use this tool: https://serverless.com/blog/static-site-post-scheduler/

If you want to go the JS route, moment.js is your friend. I wrote a calendar plugin for Jekyll ages ago. It would be pretty much the same for Hugo. I can look it up, though not sure it’s up-to-date.

1 Like