Future post scheduling

I’ve been thinking of ways to make scheduling posts easier. Geobomatic has written an entire workflow for this (ANN: Emile, a workflow companion for Zola). It seems overly complex and there might be a simpler way to do it, but it would need support in Zola.

The general idea would be that you run zola build periodically (either via cron or some other means), and add an optional front matter variable to pages called publish_at (which is a timestamp like the date variable).

The behavior inside Zola would be if a post has a publish_at value, and if it is in the future, it would behave as if the post has draft = true. If it is in the past, then the post is published as if draft is set to false (or not set). If a post doesn’t have publish_at, the behavior is as it is today.

It then becomes very simple to publish a post in the future. Set the publish_at value to the time you want the post to be published, ensure draft = false (or not set), and that’s it.

Happy to send a PR through with this change (I haven’t done anything yet, other than write this).


I’m not sure it makes sense with Zola. You would need to deploy automatically every day for that to be useful and you could just remove the draft at that time if you are doing it manually.
There’s also the minor timezone issues but that can probably be ignored.

1 Like