v3.0.0
Features ๐
๐ค Stable I18n Integration
Fully supporting i18n sites through the
V2 Partially supported it, but in v3 support is fully integrated with build-time macros support and more.
๐ Default Caching
Caching is now enabled by default for production sitemaps. Sitemaps will be cached for 1 hour.
You can change the cache time or disable caching by setting the
export default defineNuxtConfig({
sitemap: {
cacheTtl: 5 * 60 * 60 * 1000 // 5 hours
}
})
You can also provide your own cache instance by setting the
export default defineNuxtConfig({
sitemap: {
runtimeCacheStorage: {
driver: 'redis',
host: 'localhost',
port: 6379,
db: 0,
}
}
})
Learn more on the cache guide.
Improved XML Stylesheet
The UI of the sitemap.xml page has been improved slightly. It now features more useful tips and links.
You can also customise the stylesheet with the new following config:
xslTips - Toggle the tips displayed on the sitemap.xml pages.xslColumns - Customise the columns displayed on the sitemap.xml pages.
For example, you can change the columns to only show the
export default defineNuxtConfig({
sitemap: {
xslColumns: [
// URL column must always be set, no value needed
{ label: 'URL', width: '75%' },
{ label: 'Last Modified', value: 'sitemap:lastmod', width: '25%' },
],
},
})
Learn more on the Customising the UI guide.
Debug Mode
A
When you build your site with debug on, a
This is disabled by default and should only be enabled for debugging purposes.
Other Improvements
sitemap:output New Hook:
Type:
This will let you modify the string content of the final sitemap before it is returned from the server.
Can be ran in both Nitro (runtime) and Nuxt (prerendering).
sitemap:resolved New Hook:
Type:
This will let you modify the final sitemap before it is turned into a string.
Can be ran in both Nitro (runtime) and Nuxt (prerendering).
dynamicUrlsApiEndpoint Individual multi-sitemap API endpoints
- Type:
boolean | string - Default:
false
You can now give each sitemap a unique API endpoint to fetch URLs from.
export default defineNuxtConfig({
sitemap: {
sitemaps: {
foo: {
dynamicUrlsApiEndpoint: '/api/foo-sitemap'
},
bar: {
dynamicUrlsApiEndpoint: '/api/bar-sitemap'
},
},
}
})
strictNuxtContentPaths New Config:
- Type:
boolean - Default:
false
Enable when the paths of your nuxt/content md files match the routing.
This will automatically add sitemap content to the sitemap.
This is similar behaviour to using
credits New Config:
- Type:
boolean - Default:
true
Allows you to remove the "Generate by Nuxt Sitemap" comment from the generated sitemap.
xslTips New Config:
- Type:
boolean - Default:
true
Toggle the tips displayed on the sitemap.xml pages.
Deprecation
trailingSlash has been deprecatedsiteUrl has been deprecatedautoAlternativeLangPrefixes is now disabled by default. If you want to enable it, you need to set it totrue explicitly.