Skip to content

fix(sitemap): add lastmod and hreflang alternates where missing - #478

Merged
TheMeinerLP merged 1 commit into
mainfrom
fix/sitemap-lastmod-and-alternates
Oct 10, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
fix/sitemap-lastmod-and-alternates

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Collaborator

Summary

Adds lastmod where the content has a real date, and fixes event translation alternates. Counts come from the local pnpm dev sitemap, before and after this change.

Sitemap URLs lastmod before lastmod after xhtml:link alternates before / after
de-DE.xml 32 16 / 32 20 / 32 32 / 32
en-US.xml 31 15 / 31 19 / 31 31 / 31

Newly dated: the blog, projects and community POI index pages, and the blog author page (en: /en/blog/author/themeinerlp, de: /de/blog/author/themeinerlp).

What changed

  • Index pages (server/api/__sitemap__/index-pages.ts, shared/utils/indexPageSitemap.ts): the index's lastmod is the newest date among the items it lists, dated the way each item's own sitemap entry is dated. Blog uses released articles only; projects use updatedAt; community POI uses updatedAt ?? startedAt. Pages with no derivable date get no entry, so the app's own entry stands. The source adds lastmod to an existing app entry; the sitemap merges on loc and keeps the alternates.
  • Author pages (shared/utils/blogAuthors.ts): lastmod is the newest modified date of the author's released articles in that locale. updatedDate is now selected.
  • Events (shared/utils/eventRoutes.ts): translations are paired by translationKey, as the detail page pairs them, so events whose slugs differ get alternates. Only listed translations are included.
  • Shared date helpers live in shared/utils/sitemapDates.ts.

Choices and what was not changed

  • No lastmod from build or request time. Team pages, the team index, the events index, and the home, about, bluemap and community pages have no content date, so they keep no lastmod. The team data has no updated date, and no content file carries one for events.
  • Team and author alternates are unchanged. On the live sitemap and locally, every team member URL and the author page already carry three xhtml:link entries. The module pairs them by identical slug across locales, so this change does not touch them.

Tests

  • New and updated unit tests (F.I.R.S.T., pure functions, no network or D1): tests/shared/indexPageSitemap.spec.ts, tests/shared/blogAuthors.spec.ts, tests/shared/eventRoutes.spec.ts.
  • tests/architecture/module-boundaries.spec.ts: index-pages.ts is registered as a named exception, for the same Nitro locales import as team.ts, events.ts and blog-authors.ts.
  • pnpm test: 165 files, 1304 tests passing.
  • pnpm quality: ESLint errors 186 (baseline 186), TypeScript errors 3 (baseline 3). No regression.
  • pnpm typecheck reports the same 3 errors as the baseline, in layers/community-poi/composables/useCommunityPoi.ts and layers/home/composables/useHomeContent.ts. Neither file is touched here.
  • pnpm build: passes.

https://claude.ai/code/session_019zws4ceJu2jctk3XT48fMX

The blog, projects and community POI index pages and the blog author pages
now carry lastmod: the newest date among the items they list, dated as each
item's own sitemap entry is. Event translations are paired by translationKey,
as the detail page pairs them, so events whose slugs differ get alternates.

Team pages and events have no content date and keep no lastmod; nothing is
derived from the build or request time. Team and author alternates already
came from the module's sibling pairing and are unchanged.

Claude-Session: https://claude.ai/code/session_019zws4ceJu2jctk3XT48fMX
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
launchpad 9c8a844 Commit Preview URL

Branch Preview URL
Oct 10 2026, 10:26 PM

@TheMeinerLP
TheMeinerLP merged commit 3c60245 into main Oct 10, 2026
8 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/sitemap-lastmod-and-alternates branch October 10, 2026 22:43
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