Adding <lastmod> tags to the sitemap entries is a crucial enhancement for SEO. It provides search engines with information about when a page was last modified, which can improve crawling efficiency and ensure that fresh content is indexed more quickly.
This ticket proposes to enhance the buildScripts/generate-seo-files.mjs script to include the <lastmod> tag for each URL entry in the generated sitemap.xml.
Implementation Details:
- The
generate-seo-files.mjs script will need to be modified to fetch the last modification date for each content file (e.g., Markdown files in the learn directory).
- A robust way to determine the last modification date is to query the Git history for the last commit date of each file.
- The fetched date should then be formatted according to the W3C Datetime format (e.g.,
YYYY-MM-DD) and included within a <lastmod> tag for each <url> entry in the sitemap.xml.
Acceptance Criteria:
- The
sitemap.xml generated by generate-seo-files.mjs includes a <lastmod> tag for each <url> entry.
- The value of the
<lastmod> tag accurately reflects the last modification date of the corresponding content file, as determined by its Git history.
- The date format adheres to the W3C Datetime format.
Adding
<lastmod>tags to the sitemap entries is a crucial enhancement for SEO. It provides search engines with information about when a page was last modified, which can improve crawling efficiency and ensure that fresh content is indexed more quickly.This ticket proposes to enhance the
buildScripts/generate-seo-files.mjsscript to include the<lastmod>tag for each URL entry in the generatedsitemap.xml.Implementation Details:
generate-seo-files.mjsscript will need to be modified to fetch the last modification date for each content file (e.g., Markdown files in thelearndirectory).YYYY-MM-DD) and included within a<lastmod>tag for each<url>entry in thesitemap.xml.Acceptance Criteria:
sitemap.xmlgenerated bygenerate-seo-files.mjsincludes a<lastmod>tag for each<url>entry.<lastmod>tag accurately reflects the last modification date of the corresponding content file, as determined by its Git history.