Skip to content

feat: Multi sitemaps with i18n #360

@ronenteva

Description

@ronenteva

🆒 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions