Skip to content

jdevalk/astro-sitemap-index-lastmod-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

@astrojs/sitemap — sitemap index <lastmod> reproduction

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.

Steps

npm install
npm run build

Then inspect the two generated files in dist/.

Observed

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>

Expected

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.

About

Minimal reproduction: @astrojs/sitemap omits <lastmod> from sitemap-index.xml entries

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors