The v8 release focuses on a fully rewritten devtools experience and several quality of life improvements for Nuxt Content v3 and i18n users.
⚠️ Breaking Changes
Site Config v4
Nuxt Site Config is a module used internally by Nuxt Sitemap.
The major update to v4.0.0 shouldn't have any direct effect on your site, however, you may want to double-check
the breaking changes.
asSitemapCollection() Deprecated
The asSitemapCollection() composable has been replaced by defineSitemapSchema(). The old API still works but will log a deprecation warning.
import { defineCollection, z } from '#content/collections'
- import { asSitemapCollection } from '#sitemap/content'
+ import { defineSitemapSchema } from '#sitemap/content'
export const collections = {
- content: defineCollection(asSitemapCollection({
- type: 'page',
- source: '**/*.md',
- schema: z.object({ title: z.string() })
- }))
+ content: defineCollection({
+ type: 'page',
+ source: '**/*.md',
+ schema: z.object({
+ title: z.string(),
+ sitemap: defineSitemapSchema()
+ })
+ })
}🚀 New Features
defineSitemapSchema() Composable
A new composable for Nuxt Content v3 that provides a cleaner API for integrating sitemap configuration into your content collections. Supports filter, onUrl, and name options.
import { defineCollection, z } from '#content/collections'
import { defineSitemapSchema } from '#sitemap/content'
export const collections = {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
title: z.string(),
sitemap: defineSitemapSchema({
filter: entry => !entry.path?.startsWith('/draft'),
onUrl: (url) => {
// customize URL entries
return url
}
})
})
})
}definePageMeta Sitemap Configuration
You can now configure sitemap options directly in your page components using definePageMeta.
<script setup>
definePageMeta({
sitemap: {
changefreq: 'daily',
priority: 0.8
}
})
</script>i18n Multi-Sitemap with Custom Sitemaps
Custom sitemaps with includeAppSources: true are now automatically expanded per locale, generating {locale}-{name} formatted sitemaps.
Debug Production Endpoint
A new /__sitemap__/debug-production.json endpoint is available in development mode, allowing you to inspect what the production sitemap output will look like during development.
🐛 Bug Fixes
- Content v3: Filter
.navigationpaths from sitemap URL generation - Content v3: Guard
afterParsehook to prevent silent HMR failures - i18n: Include base URL in multi-sitemap redirect
- i18n: Fix exclude filters when base URL and i18n prefixes are present
- i18n: Respect
autoI18n: falseto generate single sitemap instead of per-locale sitemaps - Types: Use
robotsinstead ofindexin route rules type definition - Chunked sitemaps: Fix path resolution with
sitemapsPathPrefix: '/'
⚡ Performance
- Replaced
chalkwithconsola/utilsfor a smaller bundle - Use
URL.canParse()instead of try/catchnew URL()for URL validation - Use
addPrerenderRoutes()API instead of manual route pushing
🚀 Features
- content: Add
defineSitemapSchema()composable - by @harlan-zw in #576 (603e6)
🐞 Bug Fixes
definePageMetasitemap configuration not applied - by @harlan-zw in #572 (9f74a)- Include base URL in multi sitemap redirect - by @harlan-zw in #573 (94bc2)
- Respect
autoI18n: falseto generate single sitemap - by @harlan-zw in #570 (94458) - Allow i18n multi-sitemap with custom sitemaps - by @harlan-zw in #548 (e25b9)
- content:
- Guard afterParse hook to prevent silent HMR failures - by @harlan-zw in #577 (0ce4e)
- Filter .navigation paths and document i18n onUrl pattern - by @harlan-zw in #578 (c0058)
- i18n:
- Exclude filters with base URL and i18n prefixes - by @harlan-zw in #571 (fbc69)
- types:
- Use
robotsinstead ofindexin route rules - by @harlan-zw in #569 (e9167)
- Use