seo: make sitemap lastmod reflect real modification dates - #361
Merged
Conversation
Every URL in the live sitemap carried <lastmod>2026-09-01</lastmod> — the build date — including a blog post from July and static hosting pages. A lastmod that says "everything changed today" on every crawl carries no information, and a crawler that learns to ignore it is worse off than one that never saw the field, because it was added in the first place to tell Google what actually changed. Two causes, both needed fixing: - showLastUpdateTime was set only on the tutorials plugin, so docs and blog exposed no modification date and the sitemap fell back to build time. - The deploy workflow checked out at the default depth of 1. Docusaurus derives the date from git, and in a shallow clone every file looks like it changed in the single fetched commit — so the flag alone would not have helped. Locally this takes the sitemap from 1 distinct lastmod value to 46: docs pages now date to when they were actually edited (/docs/organizations/scim to 2026-06-01), rather than all claiming today. Note this also renders a visible "Last updated" line on docs and blog pages. That is a reasonable freshness signal for readers, but it is a visible change, not just metadata.
Deploying phasetwo-docs with
|
| Latest commit: |
44e4a60
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3545196f.phasetwo-docs.pages.dev |
| Branch Preview URL: | https://seo-accurate-lastmod.phasetwo-docs.pages.dev |
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.
Every URL in the live sitemap currently carries
<lastmod>2026-09-01</lastmod>— the build date — including a blog post from July and static hosting pages.That's worse than having no
lastmod. It was added to tell crawlers what actually changed; a field that says "everything changed today" on every crawl teaches them to ignore it.Two causes, both needed
showLastUpdateTimewas only on the tutorials plugin. Docs and blog exposed no modification date, so the sitemap fell back to build time.Effect
Locally, the sitemap goes from 1 distinct
lastmodvalue to 46:/docs/organizations/scim//blog/scaling-keycloak-event-storage//tutorials/getting-started/run-keycloak-locally/The blog post shows 2026-08-31 rather than its July publication date because that's when the file was genuinely last edited — the author byline change. That's correct:
lastmodis about modification, not publication.Heads up: this is a visible change too
showLastUpdateTimerenders a "Last updated" line on docs and blog pages. Reasonable as a freshness signal for readers, but worth a look before merging in case you'd rather not show it. It can be suppressed while keeping the sitemap benefit if preferred.Verification
pnpm buildpasseslastmod, 46 distinct dates