Releases: nuxt-modules/sitemap
v4.1.8
What's Changed
- fix: prefix strategy with i18n.pages by @PabloGBarcelo in #179
New Contributors
- @PabloGBarcelo made their first contribution in #179
Full Changelog: v4.1.7...v4.1.8
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
Bug Fixes
- content: improved nuxt/content integration (3a6be3d)
- i18n: enable filters
exclude
,include
to work (373e471), closes #164 - i18n: filter
pages
URLs into their sitemaps (87c7342) - i18n: filter user sources into appropriate sitemap when prefixed (e725761)
asSitemapUrl
composable to resolve types (1f147a3)- prerender: filter out sitemap entries in nitro prerender config (56f35f7)
v4.1.0
Notable Changes
AutoLastmod Disabled By Default
Previous to this version, autoLastmod
was enabled by default. Recently it was announced that Google will only respect lastmod
when you are accurately setting it, otherwise, it will start ignoring it.
For this reason autoLastmod
is now disabled by default. However, you can still opt-in to this feature if you'd like to.
With this, when prerendering your pages, the module will now extract the article:modified_time
to safely set the lastmod
for you.
To learn more, see the new Sitemap.xml Best Practices and Nuxt Prendering docs.
Changelog
Bug Fixes
- apply route rules (f733261)
- avoid inserting
dynamicUrlsApiEndpoint
route (3fcac13) - disable
autoLastmod
by default for best practices (51e739e) - exclude
/_nuxt/**
and/api/**
paths by default (c7f4ce0) - filter i18n URLs based on non-prefixed path (94a5214)
- only filter
_sitemap
with multi sitemaps (e662cad), closes #165 - sitemap title not rendering correctly in XSL (8fb2388)
- devtools: tidy up hints (083789d)
- i18n support i18n strategy
prefix_and_default
(8bb8adc) - i18n match non-prefixed route for i18n route rules (da59a9a)
Features
v4.0.0
Background
Over the last couple of months I've had many issues reported with similar themes:
- Dynamic URLs are hard to work with
- It's difficult to get multiple sitemaps to show the correct URLs
- I18n has many small issues
I hope this release can resolve these. It has required replacing much of the underlying logic, please test your sitemaps after upgrading.
Features
🥫 Sitemap Sources
The v4 introduces the official concept of 'sources' to your sitemaps.
Every URL within your sitemap will belong to a source. A source will either be a User source or a Application source.
This concept existed before v4 in different forms, v4 aims to clean them up and make working with them much easier.
For full documentation see Sitemap Sources.
🤝 Nuxt Dev Tools Integration
Nuxt Simple Sitemap now has a dedicated tab in Nuxt Dev Tools to help you debug.
nuxt-simple-sitemap-devtools.webm
💬 More i18n Improvements
- Locale domain support (#155)
- Support pages opt-outed using
defineI18nRoute(false)
(#126) - Only add trusted i18n routes, will use meta tags when prerendering
- Less aggressive filtering
- Opt-in to transform dynamic URLs
__i18nTransform: true
See the updated i18n documentation
🚀 Caching Improvements
Now utilises native route rules. By default will set up SWR rules for 10 minutes.
Learn more on the Sitemap Caching guide.
Other Improvements
Nitro Composables for better types
When creating an API endpoint that returns URLs you should use the new defineSitemapEventHandler
function for full TypeScript support.
// api/sitemap.ts
export default defineSitemapEventHandler(() => {
return ['/foo']
})
Prerendering Improvements
Previously prerendering was done in a Node context, this will now run in a Nitro context which will provide better consistency between prerender and runtime environments.
Video Support
Video entries are now supported properly. (#159)
⚠️ Deprecations
cacheTtl
is deprecated, you should usecacheMaxAgeSeconds
which is more explicit.inferStaticPagesAsRoutes
is deprecated, if you were using this to opt-out of pages, you should useexcludeAppSources: true
☠️ Breaking Changes
Nuxt Hooks no longer supported
If you were using Nuxt hooks to modify the prerendered sitemap, you will need to migrate these to Nitro hooks.
export default defineNuxtConfig({
hooks: {
// old - no longer supported
'sitemap:resolved': function (ctx) {},
'sitemap:output': function (ctx) {}
},
})
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('sitemap:output', async (ctx) => {
// supported!
})
})
Multi Sitemap App Sources
By default, app sources will no longer be included in multi sitemap implementations. You will need to use includeAppSources: true
to re-enable it. See Extending App Sources for more information.
Removed deprecations
- The hook
sitemap:prerender
has been removed. You should usesitemap:resolved
instead. - The config
trailingSlash
andsiteUrl
has been removed. You should use site config, see Setting Site Config. - The config
autoAlternativeLangPrefixes
has been removed. If you'd like to set up automatic alternative language prefixes use__i18nTransform
.
💚 Support my work
This release took over 40 hours.
If technical SEO developer experience in Nuxt is important to you, consider supporting my work on Nuxt SEO.