Minimal reproduction for an @astrojs/sitemap issue: per-URL <lastmod>
values are written into the child sitemaps but never into the
<sitemap> entries of sitemap-index.xml, even though that data is
already computed.
npm install
npm run buildThen inspect the two generated files in dist/.
dist/sitemap-0.xml — every URL has a <lastmod> (set via serialize
in astro.config.mjs):
<url><loc>https://example.com/</loc><lastmod>2024-09-15T00:00:00.000Z</lastmod></url>
<url><loc>https://example.com/about/</loc><lastmod>2024-09-15T00:00:00.000Z</lastmod></url>dist/sitemap-index.xml — the <sitemap> entry has no <lastmod> at all:
<sitemap><loc>https://example.com/sitemap-0.xml</loc></sitemap>The <sitemap> entry should carry the most recent <lastmod> of the URLs
in the child sitemap it points to:
<sitemap><loc>https://example.com/sitemap-0.xml</loc><lastmod>2024-09-15T00:00:00.000Z</lastmod></sitemap><lastmod> on a sitemap index entry is part of the
sitemaps.org protocol and is
used by Google
to decide which child sitemaps to recrawl. Today that signal is dropped.
Pinned to @astrojs/sitemap@3.7.2 / astro@6.3.7 so the reproduction stays
stable.