Description
The current getSitemapXml function in buildScripts/generateSeoFiles.mjs determines the <lastmod> date for an example by checking the git history of its index.html file only.
This is inaccurate because changes to other files within an example's directory (e.g., JavaScript, CSS, or resource files) do not update the <lastmod> date in the sitemap.
Desired Behavior
The <lastmod> date for an example in sitemap.xml should reflect the last commit that modified any file within that example's directory.
Implementation Suggestion
In buildScripts/generateSeoFiles.mjs, the getSitemapXml function should be modified. When collecting file paths to pass to getGitLastModifiedBatch, if a route is an example, it should pass the path to the example's parent directory (path.dirname(filePath)) instead of the path to the index.html file itself.
This will cause git log to find the most recent commit affecting any file in that directory, providing a more accurate timestamp.
Description
The current
getSitemapXmlfunction inbuildScripts/generateSeoFiles.mjsdetermines the<lastmod>date for an example by checking the git history of itsindex.htmlfile only.This is inaccurate because changes to other files within an example's directory (e.g., JavaScript, CSS, or resource files) do not update the
<lastmod>date in the sitemap.Desired Behavior
The
<lastmod>date for an example insitemap.xmlshould reflect the last commit that modified any file within that example's directory.Implementation Suggestion
In
buildScripts/generateSeoFiles.mjs, thegetSitemapXmlfunction should be modified. When collecting file paths to pass togetGitLastModifiedBatch, if a route is an example, it should pass the path to the example's parent directory (path.dirname(filePath)) instead of the path to theindex.htmlfile itself.This will cause
git logto find the most recent commit affecting any file in that directory, providing a more accurate timestamp.