Skip to content

feat: support @nuxtjs/i18n experimental compactRoutes#618

Open
harlan-zw wants to merge 1 commit into
mainfrom
feat/i18n-compact-routes
Open

feat: support @nuxtjs/i18n experimental compactRoutes#618
harlan-zw wants to merge 1 commit into
mainfrom
feat/i18n-compact-routes

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Resolves #617

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

With @nuxtjs/i18n experimental.compactRoutes: true, per-locale routes collapse into one /:locale(en|fr)/about regex route. convertNuxtPagesToSitemapEntries dropped these via its dynamic-route (:) filter, so every compacted page disappeared from the sitemap.

The micro-only expansion branch in deepForEachPage is replaced with the shared expandCompactLocaleRoute helper, so nuxt-i18n-micro and @nuxtjs/i18n compactRoutes both expand into per-locale entries. Once expanded into name___locale form, the existing grouping / alternatives / prefix_and_default logic handles every strategy unchanged. The now unused isI18nMicro option is removed. Added a @nuxtjs/i18n compactRoutes unit test.

Note

Depends on harlan-zw/nuxt-seo#558 (adds expandCompactLocaleRoute to nuxtseo-shared). CI here stays red until that ships in a nuxtseo-shared release.

convertNuxtPagesToSitemapEntries dropped compacted /:locale(en|fr)/about routes
via the dynamic-route (:) filter, so pages vanished from the sitemap when
@nuxtjs/i18n compactRoutes was enabled. The micro-only expansion branch is
replaced with the shared expandCompactLocaleRoute helper, so micro and
@nuxtjs/i18n compactRoutes both expand into per-locale entries. Removes the now
unused isI18nMicro option.

Resolves #617
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/sitemap@618

commit: 081adb3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support @nuxtjs/i18n's (experimental) compactRoutes

1 participant