withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.11k stars 2.44k forks source link

Missing sitemap entries for fallback routes (i18n) #12135

Open xentobias opened 6 days ago

xentobias commented 6 days ago

Astro Info

Astro                    v4.15.11
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The "@astrojs/sitemap" integration does not generate sitemap locations for my international routes (i18n) when the i18n.routing.fallbackType is set to "rewrite" in the configuration.

What's the expected result?

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>http://localhost:3000/</loc>
  </url>
  <url>
    <loc>http://localhost:3000/docs/</loc>
  </url>
  <url>
    <loc>http://localhost:3000/de/</loc>
  </url>
  <url>
    <loc>http://localhost:3000/de/docs/</loc>
  </url>
</urlset>

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-xntzfh-tefqcq?file=dist%2Fsitemap-0.xml

Participation

ematipico commented 5 days ago

PRs welcome. At the moment, this feature isn't supported by the RSS integration