Repository navigation
Make every sitemap lastmod track its page's content - #93
Merged
Merged
Conversation
68 of 69 dated URLs said 2026-09-29. Nine pages had no date at all. lastmod only moved when someone remembered a changelog entry, and in two weeks 35 of 55 records drifted. On 12 October nineteen compounds gained a calculator section and nineteen calculator pages were created; all thirty-eight still claimed 29 September, so the calculator pages claimed a date before they existed. Google treats a sitemap whose dates are wrong as a sitemap whose dates can be ignored. The fix keeps two sources and never mixes them for one page. Record pages stay dated by their own changelog, because they print that date three times (the Updated pill, the reference card, JSON-LD dateModified) and the sitemap has to agree with the page. Everything that prints no date, the hubs, the trust pages and the calculators, is dated from research/lastmod.json. Backfill used history, never the build date. The nineteen compounds get a dated changelog entry for the calculator section, which readers see. Hub and trust pages take the git date of their source, checked against the record data they display: nothing they show changed later. Calculator pages take 2026-10-12, the day they were created and rewritten. Records whose latest change was the 2026-09-30 relabelling of a table column keep their earlier dates, because that change is cosmetic and Google asks for lastmod to move on significant updates only. That judgment is logged in the manifest rather than made silently. Four of the nineteen entries first claimed the calculator page charts syringe units. For humanin, melanotan II, selank and TB-500 it does not: every published dose for them is per kilogram, and those pages say why there is no chart. The entries now say that instead. scripts/check_lastmod.py fingerprints the text, tag names and link targets inside <main> of every sitemap page and compares them with the manifest. A record whose content changed without a newer changelog date fails CI with a message saying what to do; --trivial "reason" accepts a cosmetic change and logs the reason; --write stamps today on pages that print no date. Scripts, styles, classes and ids are excluded, so build noise such as Astro's scoped-style hashes does not count as a change. Verified five ways: an unrecorded record change fails, the same change accepted as cosmetic passes with its date kept and the reason logged, a hub change fails then is stamped by --write, a future date fails, and changed Astro class hashes pass. It also caught a real case while this was being written: correcting those four entries changed four pages, and the guard flagged all four. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
68 of 69 dated sitemap URLs said
2026-09-29. Nine pages had nolastmodat all.What was wrong
A date only moved when someone remembered a changelog entry, and in two weeks 35 of 55 records drifted. On 12 October nineteen compounds gained a calculator section and nineteen calculator pages were created; all thirty-eight still claimed 29 September. The calculator pages claimed a date before they existed.
Two sources, never mixed for one page
dateModified); the sitemap must agree with the pageresearch/lastmod.jsonBackfill from history, never the build date
lastmod/privacyHub and trust pages take the git date of their source, checked against the record data they display; nothing they show changed later.
One judgment, logged rather than made silently. The 30 September change relabelled a compare-table column and trimmed a sentence from changelog text on 34 records. That is cosmetic, and Google asks for
lastmodto move on significant updates only, so those records keep their earlier dates. The reason is recorded in the manifest.A correction to my own entries
Four of the nineteen new entries first said the calculator page "charts syringe units". For humanin, melanotan II, selank and TB-500 it does not: every published dose is per kilogram, and those pages explain why there is no chart. The entries now say that.
The guard
scripts/check_lastmod.pyfingerprints the text, tag names and link targets inside<main>of every sitemap page and compares against the manifest. Scripts, styles, classes and ids are excluded, so build noise does not count.--write --trivial "reason"--writestamps todaylastmodin the futureIt also caught a real case unprompted: correcting those four entries changed four pages, and it flagged all four.
Runs in CI after the build. Workflow documented in
docs/content-automation.md.Gates
Content validation, registry, 36 drafter tests, 55 calculator tests, loop gate 47/47, all eight link rules, lastmod guard.
🤖 Generated with Claude Code