Commit 1262e49
committed
seo: give each sitemap-index child a lastmod
The index listed three children with no dates, so the only safe read was "re-fetch
all three". Each child now carries the newest lastmod among its own URLs.
Derived by rendering the child and scraping its <lastmod> values back out, rather
than recomputing them. The resolution order (apiReleased -> dateModified ->
pageDates -> item.date) plus the isPage/noindex/`sitemap: false` filtering is
intricate, and sitemap-urls.html is deliberately its only home; a second copy here
would be free to drift, and a drifted lastmod is worse than none — Google discounts
lastmod site-wide once it catches the file lying, and that discount would land on
the blog entries where the dates are real. Rendering twice is free in a static build.
Dates are YYYY-MM-DD, so `sort | last` is a correct maximum.
Verified the output against an independently computed max per child, and confirmed
the dates are real rather than build timestamps: sitemap-api.xml is 106 URLs at
2026-07-28 (the npm release date via apiReleased) plus exactly one at today, /api/,
which is hand-authored and dated from git history. Same shape in the blog bucket.
.com is untouched: sitemapBuckets is empty there, so it stays a flat 4-URL urlset
and never enters this branch.1 parent 18cf278 commit 1262e49
1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
17 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
18 | 45 | | |
19 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
20 | 50 | | |
21 | 51 | | |
22 | 52 | | |
| |||
0 commit comments