Drafts & Scheduled Publishing
Preview unpublished drafts locally while keeping them hidden in production, and schedule future posts with UTC-normalized publishedAt timestamps.
How Drafts Work (draft: true)
Every built-in @nuxtify/cms schema (pageSchema, articleSchema, contributorSchema, topicSchema, noteSchema, and docSchema) includes a draft boolean that defaults to false.
Add draft: true to any Markdown file while you're still writing or reviewing it:
---
title: Upcoming Release Announcement
description: Preview of our next milestone.
publishedAt: 2026-06-01T14:00:00Z
author: jane-doe
draft: true
---
What happens automatically depends on the environment:
- In development (
nuxt dev): Drafts remain visible everywhere—index pages, detail routes, navigation trees, and previous/next links—so you can author and preview them live. - In production (
nuxt build/nuxt generate):usePublicCollection,usePublicCollectionNavigation, andusePublicCollectionSurroundingsfilter outdraft: trueitems.- Direct visits to a draft's URL return a
404on built-in CMS routes. @nuxtify/cms'scontent:file:afterParsehook setssitemap: falseandrobots: falseon draft documents so they never leak intositemap.xmlor search engine indexes.
Scheduled Publishing with publishedAt
You can also schedule content to go live at a future date and time without manually toggling draft. Leave draft: false (or omit it) and set publishedAt to a future timestamp:
---
title: Summer Launch Notes
description: Everything shipping in our Q3 release.
publishedAt: 2026-07-15T13:00:00-04:00
author: jane-doe
---
During parsing (content:file:afterParse), @nuxtify/cms normalizes every valid publishedAt value—whether written as a date string with a timezone offset or a YAML Date—into a canonical 24-character UTC ISO-8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). That guarantees SQLite's lexicographical publishedAt <= nowIso query always compares exact UTC timestamps accurately across timezones.
In production, any item in a scheduled collection whose publishedAt is strictly in the future:
- Is visible in
nuxt devfor local preview. - Is filtered out of
usePublicCollection,usePublicCollectionNavigation, andusePublicCollectionSurroundingsuntilpublishedAt <= now. - Is excluded from
sitemap.xmldynamically at runtime until its release time passes. Then it becomes discoverable automatically.
Documents without a publishedAt value (such as undated docs pages) remain published normally.
Configuring content.scheduledCollections
By default, scheduled-publishing checks apply to four collections:
['articles', 'notes', 'pages', 'docs']
You can override this list in nuxt.config.ts (or app.config.ts). Your array replaces the default cleanly rather than merging into it:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxt/content', '@nuxtify/cms'],
nuxtifyCms: {
content: {
// Include a custom collection alongside articles and docs
scheduledCollections: ['articles', 'docs', 'useCases'],
},
},
})
To disable scheduled-publishing checks globally and treat every non-draft document as immediately live, pass an empty array:
nuxtifyCms: {
content: {
scheduledCollections: [],
},
}
Per-Query Overrides
When querying a collection directly with usePublicCollection, usePublicCollectionNavigation, or usePublicCollectionSurroundings, you can override scheduled filtering for a single query with { filterScheduled: true | false }:
// Include future-dated items in a custom "Upcoming" view while still excluding drafts
const { data: upcoming } = await useAsyncData('upcoming-articles', () =>
usePublicCollection('articles', { filterScheduled: false })
.order('publishedAt', 'ASC')
.all(),
)
Scheduled Posts on Static & Prerendered Sites
How scheduled content goes live depends on your rendering strategy:
- SSR (Node.js, Cloudflare Workers, serverless):
usePublicCollectionevaluatesnew Date().toISOString()on each request, andcreateSeoSchema's default@nuxtjs/sitemapfilter checkspublishedAt <= Date.now()dynamically at runtime. Scheduled items appear on your pages and insitemap.xmlautomatically as soon as theirpublishedAttime passes without needing a rebuild. If you cache routes with SWR/ISR (routeRules), the page updates on the next revalidation. - Static / Prerendered (
nuxt generateornitro.prerender): HTML andsitemap.xmlare baked at build time. Trigger a scheduled rebuild (for example, via a daily or hourly GitHub Actions cron calling your host's deploy hook) so newly live posts get prerendered and added to your sitemap.
Even on SSR deployments, if you enable sitemap: { zeroRuntime: true }, your sitemap.xml is generated at build time. Run a periodic rebuild—or omit zeroRuntime—if you want scheduled posts to appear in sitemap.xml automatically after launch.
Next Steps
- Learn how sitemaps, robots, and structured data work together in Technical SEO & Schema.org.
- Compare static, SSR, and hybrid hosting options in Rendering & Deployment.
- Inspect
usePublicCollection*query helpers in CMS Composables and scheduling helpers in Utilities.