feat: support @nuxtjs/i18n experimental compactRoutes#618
Open
harlan-zw wants to merge 1 commit into
Open
Conversation
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
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #617
❓ Type of change
📚 Description
With
@nuxtjs/i18nexperimental.compactRoutes: true, per-locale routes collapse into one/:locale(en|fr)/aboutregex route.convertNuxtPagesToSitemapEntriesdropped these via its dynamic-route (:) filter, so every compacted page disappeared from the sitemap.The micro-only expansion branch in
deepForEachPageis replaced with the sharedexpandCompactLocaleRoutehelper, sonuxt-i18n-microand@nuxtjs/i18ncompactRoutes both expand into per-locale entries. Once expanded intoname___localeform, the existing grouping / alternatives /prefix_and_defaultlogic handles every strategy unchanged. The now unusedisI18nMicrooption is removed. Added a@nuxtjs/i18ncompactRoutes unit test.Note
Depends on harlan-zw/nuxt-seo#558 (adds
expandCompactLocaleRoutetonuxtseo-shared). CI here stays red until that ships in anuxtseo-sharedrelease.