astro-lib icon indicating copy to clipboard operation
astro-lib copied to clipboard

Is there a way to group specified routes to dedicated sitemaps.xml?

Open fl0wo opened this issue 1 year ago • 0 comments

Hi, in case of long xml contents (programmatic SEO SSR pages for example), I'd like to separate the routes in separated sitemaps, e.g.:

sitemap-index.xml, contains sitemap-0.xml:

<?xml version="1.0" encoding="UTF-8"?>
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-0.xml</loc>
  </sitemap>
</sitemapindex>

What if, the main sitemap contains also sub sitemaps:

<?xml version="1.0" encoding="UTF-8"?>
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-0.xml</loc>
  </sitemap>
    <sitemap>
    <loc>https://example.com/sitemap-my-sub-route.xml</loc>
  </sitemap>
    <sitemap>
    <loc>https://example.com/sitemap-my-sub-route-second.xml</loc>
  </sitemap>
    <sitemap>
    <loc>https://example.com/sitemap-my-routes-grouped-here.xml</loc>
  </sitemap>
</sitemapindex>

Is that achievable already?

I know I can set "entryLimit: 50," and this will split equally the routes in the sitemaps, but I'd rather want to group a specified list of routes in defined sitemaps.

fl0wo avatar Aug 22 '24 15:08 fl0wo