Content Schemas
Complete Zod schema reference for Nuxt Content collections provided by @nuxtify/cms.
Overview
- Provided by:
@nuxtify/cms - Import from:
@nuxtify/cms/content - Source:
src/content.ts
@nuxtify/cms/content exports ready-to-use Zod schemas for every built-in Nuxt Content collection along with createSeoSchema. Each built-in collection schema automatically merges createSeoSchema('<collectionName>'), adding frontmatter support for robots, sitemap (with runtime draft and future publishedAt filtering), and schemaOrg.
Nuxt Content automatically provides title, description, path, stem, seo, and body fields on type: 'page' collections. The tables below list the additional fields added by Nuxtify's schemas.
Shared Schemas
createSeoSchema
createSeoSchema(name: string, options?: CreateSeoSchemaOptions) builds the SEO frontmatter schema merged into every built-in collection schema and registers a @nuxtjs/sitemap collection filter under name.
| Field | Schema Helper | Description |
|---|---|---|
robots | defineRobotsSchema({ z }) | Per-page robots directives (false, 'noindex', or structured rules). |
sitemap | defineSitemapSchema({ z, name, filter, onUrl }) | Per-page sitemap overrides (false to exclude, or { loc, lastmod, changefreq, priority }). |
schemaOrg | defineSchemaOrgSchema({ z }) | Custom Schema.org JSON-LD node(s) overriding default generated nodes. |
By default, createSeoSchema registers a runtime @nuxtjs/sitemap filter for name that excludes draft: true items, future publishedAt items (publishedAt > Date.now()), and invalid publishedAt values.
CreateSeoSchemaOptions
| Option | Type | Default | Description |
|---|---|---|---|
filter | DefineSitemapSchemaOptions['filter'] | false | Excludes drafts & future/invalid publishedAt | Custom runtime sitemap filter callback, or false to disable (and clear) the default filter for name. Because @nuxtjs/sitemap serializes callbacks via fn.toString() into the server bundle, custom callbacks must be self-contained (no outer closures). |
onUrl | DefineSitemapSchemaOptions['onUrl'] | undefined | Optional @nuxtjs/sitemap onUrl callback for customizing generated sitemap URLs. |
z | typeof z | Bundled zod | Optional Zod instance override forwarded to @nuxtjs/robots, @nuxtjs/sitemap, and nuxt-schema-org schema builders. |
imageSchema
Reusable image object schema used across collections.
| Field | Type | Required | Description |
|---|---|---|---|
src | string | Yes | Image path or URL (used as fallback ogImage and Schema.org image). |
alt | string | Yes | Descriptive alt text. |
articleSchemaTypeEnum
Allowed values for schemaType on articles, notes, and docs:
'Article''BlogPosting''NewsArticle''TechArticle''SocialMediaPosting'
Collection Schemas
pageSchema
Used for top-level marketing and legal pages (content/*.md).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
publishedAt | string | Date | Yes | — | Publication date (normalized to UTC ISO-8601; supports scheduled publishing). |
updatedAt | string | Date | No | undefined | Last updated timestamp (emitted as dateModified in Schema.org). |
overline | string | No | undefined | Eyebrow text displayed above the page title. |
align | 'left' | 'center' | 'right' | No | undefined | Header alignment passed to PageTitle. |
showTitle | boolean | No | true | Set to false on custom MDC landing pages that render their own PageHero. |
image | imageSchema | No | undefined | Page feature / Open Graph image. |
draft | boolean | No | false | Hides the page from queries, sitemap, and robots outside dev mode. |
robots, sitemap, schemaOrg | createSeoSchema('pages') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
articleSchema
Used for long-form blog posts (content/articles/*.md).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
summary | string (max 250) | No | undefined | Short excerpt shown on ArticleCard and used as Schema.org description fallback. |
publishedAt | string | Date | Yes | — | Publication date (supports scheduled publishing). |
updatedAt | string | Date | No | undefined | Last updated timestamp. |
author | string | Yes | — | Contributor slug matching a file in content/contributors/ (e.g., 'jane-doe'). |
image | imageSchema | No | undefined | Hero / Open Graph image. |
draft | boolean | No | false | Excludes the article outside dev mode when true. |
topics | string[] | No | [] | Array of topic slugs matching content/topics/. The first topic displays as the primary topic. |
readTime | number | string | No | undefined | Optional manual reading time override (otherwise auto-calculated by useReadingTime). |
toc | boolean | No | true | Controls whether the table of contents renders on this article. |
schemaType | articleSchemaTypeEnum | No | undefined | Overrides content.articles.schemaType (default 'Article'). |
robots, sitemap, schemaOrg | createSeoSchema('articles') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
contributorSchema
Used for author and team profiles (content/contributors/*.md).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Contributor full name. |
jobTitle | string | No | undefined | Role or title displayed in AuthorByline and ProfilePage Schema.org. |
honorificSuffix | string | No | undefined | Optional credentials suffix (e.g., 'PhD'), appended via honoraryName(). |
image | imageSchema | No | undefined | Avatar / profile photo. |
draft | boolean | No | false | Excludes the profile outside dev mode when true. |
socials | object | No | undefined | Optional social URLs: bluesky, facebook, instagram, github, linkedin, pinterest, tiktok, x, youtube, website (rendered as icon buttons and Schema.org sameAs). |
robots, sitemap, schemaOrg | createSeoSchema('contributors') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
topicSchema
Used for article category hubs (content/topics/*.md).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
image | imageSchema | No | undefined | Optional topic image. |
draft | boolean | No | false | Excludes the topic outside dev mode when true. |
robots, sitemap, schemaOrg | createSeoSchema('topics') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
noteSchema
Used for short-form notes (content/notes/*.md, when content.notes.enabled is true).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
publishedAt | string | Date | Yes | — | Publication date (supports scheduled publishing). |
updatedAt | string | Date | No | undefined | Last updated timestamp. |
author | string | Yes | — | Contributor slug matching content/contributors/. |
image | imageSchema | No | undefined | Optional image. |
draft | boolean | No | false | Excludes the note outside dev mode when true. |
tags | string[] | No | [] | Array of tag strings powering /tags/:slug pages. |
schemaType | articleSchemaTypeEnum | No | undefined | Overrides content.notes.schemaType (default 'BlogPosting'). |
robots, sitemap, schemaOrg | createSeoSchema('notes') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
docSchema
Used for documentation pages (content/docs/**).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
icon | string | No | undefined | Optional MDI icon rendered next to the page in DocsSidebar. |
publishedAt | string | Date | No | undefined | Optional publication timestamp (supports scheduled publishing when set). |
updatedAt | string | Date | No | undefined | Optional last updated timestamp. |
image | imageSchema | No | undefined | Optional Open Graph / Schema.org image. |
toc | boolean | No | true | Set to false to hide the right-hand table of contents on this page. |
prevNext | boolean | No | true | Set to false to hide previous/next pagination cards on this page. |
draft | boolean | No | false | Excludes the doc page from sidebar navigation, queries, and sitemap outside dev mode. |
schemaType | articleSchemaTypeEnum | No | undefined | Overrides content.docs.schemaType (default 'TechArticle'). |
robots, sitemap, schemaOrg | createSeoSchema('docs') | No | — | Inherited SEO frontmatter fields and runtime sitemap filter. |
Extending Schemas for Custom Collections
Every schema exported from @nuxtify/cms/content is a standard Zod object. You can extend a built-in schema with .extend() or build a standalone schema with z.object()—keep .merge(createSeoSchema('<collectionName>')) even when extending a built-in schema like pageSchema, because each built-in schema registers its @nuxtjs/sitemap filter under its own collection name (such as 'pages') rather than your custom collection name:
// content.config.ts
import { defineCollection, defineContentConfig } from '@nuxt/content'
import { createSeoSchema, pageSchema } from '@nuxtify/cms/content'
import { z } from 'zod'
const useCaseSchema = pageSchema.extend({
label: z.string(),
related: z.array(z.string()).default([]),
}).merge(createSeoSchema('useCases'))
const episodeSchema = z.object({
publishedAt: z.union([z.string(), z.date()]),
draft: z.boolean().default(false),
episodeNumber: z.number(),
season: z.number().optional(),
episodeType: z.enum(['full', 'trailer', 'bonus']).default('full'),
}).merge(createSeoSchema('episodes'))
export default defineContentConfig({
collections: {
useCases: defineCollection({
type: 'page',
source: 'use-cases/*.md',
schema: useCaseSchema,
}),
episodes: defineCollection({
type: 'page',
source: 'episodes/*.md',
schema: episodeSchema,
}),
},
})