Field note · July 28, 2026

How the scheduled posts work

The build refuses to publish a page whose date has not arrived, and a daily job does the rest.

1 min read ·Data engineering ·engineering

There are posts in this repository dated months from now. They are written, committed, and invisible.

The mechanism is about four lines. Every post has a date in its front matter. At build time:

js
const publish = (docs) =>
  config.showScheduled ? docs : docs.filter((d) => !d.scheduled);
// scheduled = date > buildDate

A scheduled post gets no page at all — not a hidden one, not a noindex one. It is absent from the output, the sitemap, the RSS feed, and the search index. There is nothing to find, which is the only version of this that actually works. A "hidden" page with a URL is a page.

The publishing happens because a GitHub Action rebuilds the site every morning on a cron. Same commit, different build date, and any post whose day has arrived appears. Nobody touches anything.

Two details that took a second attempt.

The build date must be the actual date, not the commit date. The first version derived it from git, so a scheduled rebuild produced identical output forever. It now takes the current date, with an override for testing.

npm run build:drafts shows everything, so we can proofread a scheduled post without waiting for it. That flag never runs in CI.

Why bother? Partly because writing in bursts and publishing on a rhythm is a better fit for how the work actually happens. Partly because it means this site keeps updating during quiet periods without anyone being on the hook.

The 404 page says "no rows returned — or it is a scheduled post whose date has not arrived yet", which is true, and is the only hint you get.