Skip to content

feat: support @nuxtjs/i18n experimental compactRoutes#618

Merged
harlan-zw merged 2 commits into
mainfrom
feat/i18n-compact-routes
Jun 8, 2026
Merged

feat: support @nuxtjs/i18n experimental compactRoutes#618
harlan-zw merged 2 commits 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: 121719b

@harlan-zw harlan-zw merged commit 48f658f into main Jun 8, 2026
10 checks passed
@harlan-zw harlan-zw deleted the feat/i18n-compact-routes branch June 8, 2026 16:02
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