Repository navigation
feat(sitemap): add accurate lastmod from each doc's last content change - #928
Open
amaan-bhati wants to merge 1 commit into
Open
amaan-bhati wants to merge 1 commit into
amaan-bhati wants to merge 1 commit into
Conversation
This branch has not been 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.
What has changed?
Adds an accurate
<lastmod>to the docs sitemap, and fixes the "Last updated" date anddateModifiedon every doc page.Before this PR:
<lastmod>(the sitemap plugin'slastmodoption was unset).fetch-depth: 1), so every page reported the date of the newest commit. Live check: every page I sampled had the samedateModified(2026-10-11).What this PR does:
src/lastUpdate/contentLastUpdate.js): for each doc, walks git history and uses the last commit that changed the Markdown body..lastmod-ignore-revs(works like.git-blame-ignore-revs).last_update.datein front matter still wins.markdown.parseFrontMatter, so no doc files change.lastmod: "date"in the sitemap plugin config.fetch-depth: 0inmain.yml(deploy) andbuild_and_check.yml(PR preview).DOCUSAURUS_DISABLE_LAST_UPDATE, or in a shallow clone, it logs a warning and falls back to Docusaurus's default behaviour.Why: Google and Bing use
<lastmod>only when it is consistently accurate. Dates that move without real changes get ignored for the whole sitemap.Type of change
How Has This Been Tested?
yarn buildpasses.build/docs/sitemap.xml: 216 of 217 URLs now carry<lastmod>(only/docs/search/has none), with dates from 2023-10 to 2026-10 instead of a single date.concepts/general-glossaryhasdateModified2023-11-29;running-keploy/cli-commandshas 2026-10-07.Checklist: