Introduction

The v4 major of Nuxt Sitemap is a simple release to remove deprecations and add support for the Nuxt SEO v2 stable.

Breaking Features

Site Config v3

Nuxt Site Config is a module used internally by Nuxt Sitemap.

The major update to v3.0.0 shouldn't have any direct effect on your site, however, you may want to double-check the breaking changes.

Removed inferStaticPagesAsRoutes config

If you set this value to false previously, you will need to change it to the below:

export default defineNuxtConfig({
    sitemap: {
-       inferStaticPagesAsRoutes: false,
+       excludeAppSources: ['pages', 'route-rules', 'prerender']
    }
})

Removed dynamicUrlsApiEndpoint config

The sources config supports multiple API endpoints and allows you to provide custom fetch options, use this instead.

export default defineNuxtConfig({
    sitemap: {
-       dynamicUrlsApiEndpoint: '/__sitemap/urls',
+       sources: ['/__sitemap/urls']
    }
})

Removed cacheTtl config

Please use the cacheMaxAgeSeconds as its a clearer config.

export default defineNuxtConfig({
    sitemap: {
-       cacheTtl: 10000,
+       cacheMaxAgeSeconds: 10000
    }
})

Removed index route rule / Nuxt Content support

If you were using the index: false in either route rules or your Nuxt Content markdown files, you will need to update this to use the robots key.

export default defineNuxtConfig({
  routeRules: {
    // use the `index` shortcut for simple rules
-    '/secret/**': { index: false },
+    '/secret/**': { robots: false },
  }
})
Did this page help you?