I am familiar with enabling future posts in Jekyll using various methods (config, command line). However, I want to leave that feature off. Is there a way I can display future posts programmatically? Ideally, I create a special page (hidden from menu) where I or my content writers can preview the post, but not have to deal with Jekyll settings, command line options, and so on.
One of the reasons I want to handle it this way (read the future post, but not enable future posts) is because I cannot filter posts up to a certain date without re-building my site. I know there are ways to run jobs that update my repo regularly, but I would rather just programmatically select future posts without all that extra maintenance.
Thanks!
One solution is to parallel build the site to a different URL (known only to your team and maybe password protected) as a staging site - where future posts are allowed and any prod settings are disabled like analytics.
Another way is to allow future dated posts to always publish but to adjust your blog post listing to only show posts not future dated. This could be done with 2 lines added to the existing post listing (I like minima homepage as a start)
You can schedule a daily build easily with GH Actions. Netlify doesn’t have a schedule but you can hit an endpoint to rebuild
Alternatively you can use a bit of javascript to dynamically hide posts after today’s date and that is always up to date.
You could use a future posts page not listed on your navbar so these posts can be seen. You can also just find posts on a site map but that is not so nice
Thank you for the great ideas. Too bad there isn’t a simpler way, but I will look into the each.