Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sitemap] Support dynamic i18n route keywords #307

Open
Bombastickj opened this issue Sep 4, 2024 · 2 comments
Open

[Sitemap] Support dynamic i18n route keywords #307

Bombastickj opened this issue Sep 4, 2024 · 2 comments

Comments

@Bombastickj
Copy link

Describe the bug

Hi,

I've been attempting to create a correctly translated sitemap in Nuxt 3 using the @nuxt/sitemap module, but I'm facing some difficulties with dynamic routes. Below is the summary of my discussion with @harlan-zw:

Issue Summary

  • Base URL Configuration: Encountering issues while translating dynamically generated entries using i18n with differentDomains (missing home page URL).
  • Static and Dynamic Routes: While static routes are correctly inferred in the sitemap, dynamically generated routes are not.
  • Multi-Sitemap: Dynamically generated routes are not correctly inferred / hreflangs are not filled and remain zero.

Reproductions

  1. Initial Setup:
    Minimal Reproduction Example
    Expected behavior: Three entries in each translated sitemap.

  2. Missing Homepage / Incorrectly Inferred Dynamic Routes:
    Minimal Reproduction Example

  3. Multi-Sitemap Configuration:
    Multi-Sitemap Example
    Issue: hreflangs remain zero.

  4. Using defineI18nRoute:
    Example with defineI18nRoute
    Issue: Dynamic routes still don't get translated properly.

Request

Could you please investigate the support for translating dynamically generated i18n routes in the @nuxt/sitemap module?

Additional Information

For the time being, I'm using defineI18nRoute with partial success but still facing issues with dynamic routes. Any suggestions or potential fixes would be highly appreciated.

Thank you for your assistance and looking forward to a resolution!

Best regards,
Jonas

Reproduction

https://stackblitz.com/edit/nuxt-starter-nc3hjd?file=nuxt.config.ts

System / Nuxt Info

No response

@harlan-zw harlan-zw changed the title Bug/Feature Request: Support for Translating Dynamically Generated i18n Routes in @nuxt/sitemap [Sitemap] Support dynamic i18n route keywords Sep 5, 2024
@harlan-zw
Copy link
Owner

Needs to support Nuxt I18n path matching with the Nuxt pages features:

-| pages/
---| index.vue
---| users-[group]/
-----| [id].vue
-| pages/
---| index.vue
---| (marketing)/
-----| about.vue
-----| contact.vue

I18n reference: https://i18n.nuxtjs.org/docs/guide/custom-paths#example-3-dynamic-routes

@harlan-zw
Copy link
Owner

Just a small update on this, I did start investigating and was confirmed in my suspicious that it was going to be quite painful. So will need to try again when I have a good time to sit down with it.

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

No branches or pull requests

2 participants