Scheduled publishing (embargo)
An investigation can be finished, reviewed and merged to main a day early, and go live by itself at an exact minute. Until that minute it is not hidden — it is absent. It is in no deployment, no database, no sitemap, no llms.txt, no search index and no image directory that anybody outside the newsroom can reach.
That is a stronger promise than "the page 404s", and it has to be, because almost nothing on this site needs a page request to leak an article:
@nuxt/contentpublishes every collection as a downloadable SQL dump under/__nuxt_content/.- The sitemap and
llms.txtare generated at build time. /nland/nl/onderzoekare prerendered to static HTML.- Vercel's CDN caches rendered pages for up to an hour.
public/is copied into the deployment verbatim.
So a release is not a flag being flipped. It is a new deployment, built in advance and promoted onto the domain at the exact second.
Scheduling an article
One field, on the investigation's index.md, in both locales:
---
title: "Beter Leven, wassen neus"
published: true
date: 2026-09-24
modifiedAt: '2026-09-24'
publishAt: '2026-09-24T12:00:00+02:00'
---That is the whole of it. Everything else follows.
The offset is mandatory
publishAt: '2026-09-24T12:00:00' fails the build, on purpose. A value without an offset is read in the local timezone of whatever machine parses it: 12:00 for the editor who typed it in Amsterdam, 14:00 for the UTC builder that actually releases it. Nothing would report the difference. The article would simply not be there at noon.
Write +02:00 (Dutch summer time), +01:00 (Dutch winter time) or Z (UTC). If you are unsure which, +02:00 is right from the last Sunday in March to the last Sunday in October.
published and publishAt are different questions
| meaning | in the database? | in listings? | |
|---|---|---|---|
published: false | not finished | yes | no |
publishAt in the future | finished, not yet public | no | no |
A draft stays readable on acceptance while it is being written. An embargoed article is finished; it is removed from the build entirely.
What goes with it
You schedule the investigation. The build works out the rest from the content tree, so there is no second list to keep in step:
- its
index.md, its chapters, itsbronnen/and its companion pieces; - the observations that record it;
- every location only this investigation filmed;
public/images/investigations/{slug}/, kept out of the build output (never deleted from the repository);- its entry in Nuxt Studio's media catalogue and in the generated image-size map, both of which are public JavaScript;
- its chapter 301s, withheld until the URLs are real.
A location that a published investigation also filmed stays public. It keeps its page and its place on the map; it just does not mention the investigation that has not been released, because that observation is gone with it.
How the files are actually kept out
The build is not told to skip them. It is pointed at a tree that does not contain them: an enforcing build mirrors content/ into .data/embargo-content/ without the withheld files, and every collection's cwd points at the mirror.
The obvious implementation — naming the files in source.exclude — was tried first and leaked. nuxt-studio serialises every resolved collection source into a public client chunk, so the deployment shipped a comma-separated list naming the investigation folder, all five location files and all five observation files it was hiding, at a URL every visitor loads. pnpm embargo:verify found it. Moving cwd instead means the collection config contains nothing to learn.
Four things that do not read the content database
Keeping an investigation out of the database hides it from everything that reads content. These do not, and each one shipped the filenames until it was closed:
| what leaked | where it is closed | |
|---|---|---|
public/ is copied verbatim | the images themselves, at guessable URLs | nitro.ignore in nuxt.config.ts |
| Nitro's public-asset manifest | every path, size and etag, compiled into nitro.mjs | same — the manifest is globbed from the output, so the files must never be copied |
| Nuxt Studio's media catalogue | the slug and the ordered chapter list, in a public client chunk | the app:templates hook in nuxt.config.ts |
build/image-dimensions.ts | the image directory and every chapter filename, in the client bundle | writeImageDimensions |
Two build hooks (compiled, then rollup:before) were tried for the first two and both looked correct. Neither is early enough: Nitro globs the output directory into its manifest from inside getRollupConfig, which is called on the line above the rollup:before hook. The files have to not be copied at all.
The lesson worth carrying: anything that enumerates public/ or the collection config is a leak surface, and nuxt-studio is the first place to look when this mechanism is next extended.
Scheduling is a statement that the piece is finished
The build gates do not soften for an embargoed article. An ::open-decision block, a publishAt without an offset, or a placeholder film (https://vimeo.com/nog-aan-te-leveren) fails every build but acceptance, whether or not the article is embargoed.
That is deliberate. If it merges to main, it ships. Nothing about a scheduled investigation should be discovered at 11:59.
What you see where
| embargo enforced? | what an editor sees | |
|---|---|---|
| Production (ongehoord.nl) | yes | nothing, until the minute |
| Vercel preview deployments | yes | nothing |
| Acceptance | no | the whole article, with an "Onder embargo tot …" banner |
pnpm dev | no | the same |
pnpm embargo:verify | yes | see below |
Acceptance is the exception because the whole deployment is behind a password, so there is nobody to hide from, and reading the piece before it goes out is the reason to open acceptance at all.
To prove the mechanism itself on acceptance, set NUXT_EMBARGO_ENFORCE=1 on that environment and redeploy. The article should vanish from it completely. Remove the variable afterwards, or the editors lose their preview.
The release
.github/workflows/embargo-release.yml runs every ten minutes and does nothing at all unless a release is due. When one is:
- It asks production, over an authenticated
GET /api/__embargo, which moment the live deployment was built for. - If a release is due within the next hour, it runs
vercel deploy --prod --skip-domain --build-env NUXT_RELEASE_AS_OF=<the moment>. That is a full production build frommain, with its clock moved forward, sitting on no domain. - It sleeps until the exact second.
- It runs
vercel promote <url> --yes. - It asks production again and fails loudly if the promote did not take.
The hour of lookahead is there because GitHub's scheduled workflows are best-effort and routinely run late. The sleep inside the job is accurate to the second; the cron only has to be roughly on time.
The workflow only ever touches production and only ever builds main. Acceptance is never involved.
Break glass
Actions → Embargo release → Run workflow. Leave release_at blank to release whatever production says is next, or give an instant (with its offset) to release as of that moment. An instant in the past releases immediately: the deployment is built and promoted without a wait.
This works from a phone.
When an ordinary deploy races a release
Three cases, all of which resolve themselves:
A push to main while the staged deployment is being built. The staged deployment was built from the main that existed when the workflow checked it out, so the push is not in it. The promote still happens on time. Vercel then builds the pushed commit as an ordinary production deployment and it takes over when it is ready — with a wall clock past the release moment, so the article stays live. The release is never reverted; a few minutes of the newest commit are simply delayed.
A push to main immediately after the promote. Same outcome, for the same reason: any build taken after the release moment contains the article, because publishAt is in its past.
The promote fails, or a build taken before the moment lands after it. Production then reports stale: true — it still names a release moment that has passed. The next run of the workflow fires the Vercel deploy hook, and a fresh build (whose wall clock is now past the moment) recovers production within about fifteen minutes. Nobody has to notice.
The one case that does not self-heal is a release whose moment has not arrived yet: nothing can make that live early, which is the point.
Verifying it
pnpm embargo:verifyTwo full production builds of the real content tree, one second apart:
- a.
NUXT_RELEASE_AS_OF=2026-09-24T09:59:59Z— every byte of.output(and.vercel/output, when present) is scanned for the article's slug, its headline, its phrase, its locations, its chapters and its image directory. Compressed SQL dumps are decompressed and scanned too, because that blob is the most complete copy of the content database in the deployment. Nothing may match. - b.
NUXT_RELEASE_AS_OF=2026-09-24T10:00:00Z— the built server is started, and the article must render 200 and appear in the overview, the sitemap, the search index andllms.txt.
It takes a while: two production builds.
The pilot still carries unresolved ::open-decision blocks and a placeholder film, which a dated build refuses to start on. The script does not weaken that gate; it takes a copy of the pilot's files, resolves them for the duration of the run, and restores the originals in a finally and on SIGINT. If it is ever killed hard, git status will show the pilot's files modified; git checkout content/ puts them back.
One expected side effect
While an embargo is active, an enforcing build rewrites the generated build/image-dimensions.ts without the embargoed entries — they would otherwise ship the slug and every chapter's filename to every visitor, in plain text, in the client bundle. The entries come back on the first build after the release. If a local build leaves that file modified and you do not want the change, git checkout build/image-dimensions.ts.
Secrets and environment variables
GitHub Actions secrets, for the release workflow:
| secret | what it is |
|---|---|
VERCEL_TOKEN | a Vercel access token with deploy and promote rights |
VERCEL_ORG_ID | team_BIYHidbNcb91e5W81ko2PQE6 |
VERCEL_PROJECT_ID | prj_m5lBIzLT7NkUFOfhgFjHjWUe1iWL |
EMBARGO_STATUS_TOKEN | a long random string, shared with production |
VERCEL_DEPLOY_HOOK_URL | a production deploy hook, for the self-heal path |
gh secret set VERCEL_TOKEN # paste a token from vercel.com/account/tokens
gh secret set VERCEL_ORG_ID --body 'team_BIYHidbNcb91e5W81ko2PQE6'
gh secret set VERCEL_PROJECT_ID --body 'prj_m5lBIzLT7NkUFOfhgFjHjWUe1iWL'
gh secret set EMBARGO_STATUS_TOKEN --body "$(openssl rand -hex 32)"
gh secret set VERCEL_DEPLOY_HOOK_URL # create one under Project → Settings → Git → Deploy Hooks (branch: main)And the same status token on Vercel production, which is what makes the endpoint answer at all:
vercel env add NUXT_EMBARGO_STATUS_TOKEN productionWithout it, GET /api/__embargo returns 404, not 401: an environment that has not been given the secret does not even confirm the endpoint exists.
The workflow degrades quietly rather than failing every ten minutes: with no EMBARGO_STATUS_TOKEN it logs a warning and stops.
Staged deployments are only as private as Deployment Protection
Between step 2 and step 4 above, a fully built production deployment carrying the unreleased article exists at a *.vercel.app URL. Two things are meant to keep it private:
- Vercel Deployment Protection, which puts every deployment URL other than the production domains behind Vercel authentication. This is the real protection.
server/middleware/canonical-host.ts, which bounces requests on a non-canonical host towww.ongehoord.nl. This is a redirect, not an access control; treat it as a courtesy, not a lock.
Check the project's protection setting before the first real release (Vercel → Project → Settings → Deployment Protection → Standard Protection). If it is off, the staged URL is readable by anyone who has it for the minutes it is staged.
Reference
| thing | where |
|---|---|
| the scan, the clock, every exclusion | build/embargo.ts |
| the choke point (the staged content mirror) | content.config.ts |
| the editorial gates | build/contentIntegrity.ts |
| stripping images from the build output | nitro.hooks.compiled in nuxt.config.ts |
| the status endpoint | server/api/__embargo.get.ts |
| the banner | app/components/investigation/article/EmbargoBanner.vue |
| the release | .github/workflows/embargo-release.yml |
| the proof | scripts/embargo-verify.ts |