npm @nuxtjs/sitemap 8.0.0
v8.0.0

5 hours ago

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 .navigation paths from sitemap URL generation
  • Content v3: Guard afterParse hook 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: false to generate single sitemap instead of per-locale sitemaps
  • Types: Use robots instead of index in route rules type definition
  • Chunked sitemaps: Fix path resolution with sitemapsPathPrefix: '/'

⚡ Performance

  • Replaced chalk with consola/utils for a smaller bundle
  • Use URL.canParse() instead of try/catch new URL() for URL validation
  • Use addPrerenderRoutes() API instead of manual route pushing

   🚀 Features

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

Don't miss a new sitemap release

NewReleases is sending notifications on new releases.