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

feat: Multi sitemaps with i18n #360

Open
ronenteva opened this issue Sep 16, 2024 · 3 comments
Open

feat: Multi sitemaps with i18n #360

ronenteva opened this issue Sep 16, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ronenteva
Copy link

🆒 Your use case

When using both multi sitemaps and i18n, it will be useful to still have a separate sitemap for each language.

nitro.config.js:

sitemap: {
    sitemaps: {
      shirts: {
        sources: ['/api/sitemap/shirts']
      }
    }
  }

/api/sitemap/shirts:

export default defineSitemapEventHandler(async () => {
  return [{
    loc: `/shirts/white`,
    _i18nTransform: true
  }];
});

This will generate /__sitemap__/shirts.xml which contains pages in all languages.

🆕 The solution you'd like

/__sitemap__/shirts/en.xml
/__sitemap__/shirts/es.xml
...

🔍 Alternatives you've considered

No response

ℹ️ Additional info

Thank you :pr

@ronenteva ronenteva added the enhancement New feature or request label Sep 16, 2024
@harlan-zw
Copy link
Collaborator

Google does not support nesting multiple index sitemaps within each other so this is not something I will implement, sorry.

@harlan-zw harlan-zw closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2024
@ronenteva
Copy link
Author

Oh right, sorry about that.
What about /__sitemap__/shirts-en.xml?

@harlan-zw
Copy link
Collaborator

It's possible but it's unlikely I'll attempt this any time soon as there's quite a bit of complixity involved in supporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants