Skip to content

Sitemap: omit lastmod when the git date is unknown, never the build date (TECH-013) - #74

Merged
mattwebhub merged 1 commit into
mainfrom
technical/sitemap-omit-unknown-lastmod
Nov 2, 2026
Merged

mattwebhub merged 1 commit into
mainfrom
technical/sitemap-omit-unknown-lastmod

Conversation

@mattwebhub

@mattwebhub mattwebhub commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

/sitemap.xml no longer writes the build date as <lastmod>. When a route's git date is unknown, its entry is listed with no <lastmod>. The build warning stays and names every affected URL, now worded [sitemap] WARNING: lastmod omitted for N URL(s).

Why (TECH-013)

TECH-013 requires accurate lastModified. Current production is dpl_EGLDvzrWVtsRxYdMpyjUzMAchAXX, a CLI upload made at 12:21 UTC on 2026-11-02 ("Downloading 648 deployment files", no git clone). It replaced the Git build of 4caceab (dpl_GFntYgBFEiFVS7mrrhfLhiXdPz7D, 12:19 UTC). That Git build had no warning. A CLI upload has no .git, so the old fallback stamped the build date: the log shows lastmod fell back to the build date (2026-11-02) for 39 URL(s), and the live sitemap has 39 of 46 URLs dated today with no content change. This would repeat on every CLI deploy made on a new day.

Vercel Git builds do have the history. The preview build of this PR (toone-landing-owzl4v6na, Git clone) serves 46 of 46 URLs with real commit dates, for example /en/how-to/features/explore at 2026-10-30, which is its git date. Google ignores lastmod once it proves wrong. A missing lastmod is valid sitemap XML.

Change

  • app/sitemap.xml/route.ts: the order is git commit date, then the declared editorial date, then omit. url() drops the tag when the date is null.
  • lib/source-date.ts: BUILD_DATE is removed so nothing can fall back to it again. /en/governance dateModified was already git date, then frontmatter, and it is unchanged.
  • Tests: tests/routing/sitemap-lastmod.test.ts covers the case with git (real dates). tests/routing/sitemap-lastmod-nogit.test.ts covers no git (GIT_DIR set to a missing path): no lastmod, nothing dated today on git-backed routes, and the warning count matches. The no-git test fails on main and passes here.

Checks

  • npm test: pass, 0 failures.
  • npm run build with git: no [sitemap] warning.
  • npm run build without git (GIT_DIR=/nonexistent, same as a CLI upload with no .git): exit 0. The warning lists 39 URLs. next start serves 46 URLs, 7 with <lastmod> (all editorial dates, 2026-09-28) and 0 dated 2026-11-02.
  • Playbook 02/04: no page copy or URL changes. Playbook 03: TECH-013 now passes, and TECH-024 is unaffected (same URL set).

After merge

  • Git production build (the merge itself): there should be no [sitemap] warning, and every URL should carry its commit date.
  • Any later CLI upload (vercel --prod): the log shows lastmod omitted for 39 URL(s) and has no fell back line, and no URL claims the deploy day. The way to keep real dates is to let the Git build be the release and stop CLI production deploys.

Do not merge without the owner's yes. Merging to main deploys to production within about a minute.

…ate (TECH-013)

Vercel builds (Git and CLI) can lack git history. The sitemap then stamped
the build date on every git-backed route: on 2026-11-02, 39 of 46 URLs
claimed a change on deploy day. An unknown date is now omitted; the build
warning still names every affected URL. BUILD_DATE is removed so nothing
can fall back to it again.
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
toone-landing Ready Ready Preview Nov 2, 2026 12:50pm UTC

This branch was successfully deployed

1 active deployment
Preview — c065591e Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant