Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

My static Nuxt blog publishes itself: drafts, scheduled "drip", and auto-rebuilds

I run my freelance site as a fully static (SSG) Nuxt site. It's fast, cheap to host, and boring in the good way. But static sites are genuinely bad at one thing: publishing an article next Tuesday at 9am. There's no server rendering each request, so "schedule this post" doesn't exist — something has to rebuild the site at the right moment. I also write in bursts. Some evenings I'll draft two or…

This freelancer uses a fully static Nuxt site to publish articles, ensuring fast performance and low hosting costs. However, static sites struggle with scheduled publishing, as there's no server rendering each request. To address this, the author developed a small publishing engine with features such as drafts, a scheduled queue ("drip"), and automatic rebuilds.

The stack includes Nuxt 4 for prerendering (SSG) each public page, Storyblok as the headless CMS to store content, a Nitro server (similar Nuxt app) on a small VPS kept alive by PM2, and GitHub Actions for deployment and rebuild.

The core concept is that on an SSG site, "publish" consists of two actions: (1) adding content to the CMS and (2) rebuilding the static site to make it visible. Scheduling is simply doing both later, automatically.

1. Drafts: Writers can create markdown articles and decide later if they should be published. Drafts are saved server-side (Nitro's storage layer) and have a status (draft, scheduled, or published) with a publish date.

2. The queue and the "drip": A Nitro scheduled task runs hourly, checking if any content is due to publish. If so, it converts the markdown to Storyblok's richtext format, pushes it to the CMS, and triggers a site rebuild for all due articles in a single operation.

3. Markdown → CMS → rebuild: When an article is due, it is transformed from markdown to Storyblok's richtext format, pushed to the CMS, and then the site is rebuilt. Without this rebuild, the article won't appear.

The author faced a few challenges, including the server still being necessary (the scheduler and admin require a running Nitro server), the scheduler only firing if something is running, and the need to consider timezones when setting publish dates.

By implementing this system, the author can draft articles on Sundays, distribute them over the next two weeks, and let the site rebuild itself automatically. The publishing engine powers the blogger's freelance site, dibodev.fr, and represents a custom tool for small businesses that the author frequently uses in their day job.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Tuesday 18 August →