---
id: 7742
title: 'Enhance Sitemap Generation: Add `lastmod` based on Git History'
state: CLOSED
labels:
  - enhancement
  - ai
assignees:
  - tobiu
createdAt: '2025-11-11T11:37:46Z'
updatedAt: '2025-11-11T11:55:15Z'
githubUrl: 'https://github.com/neomjs/neo/issues/7742'
author: tobiu
commentsCount: 0
parentIssue: 7446
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2025-11-11T11:55:15Z'
---
# Enhance Sitemap Generation: Add `lastmod` based on Git History

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.

## Timeline

- 2025-11-11T11:37:46Z @tobiu assigned to @tobiu
- 2025-11-11T11:37:47Z @tobiu added the `enhancement` label
- 2025-11-11T11:37:48Z @tobiu added the `ai` label
- 2025-11-11T11:38:31Z @tobiu added parent issue #7446
- 2025-11-11T11:39:35Z @tobiu referenced in commit `6d4e0d1` - "Enhance Sitemap Generation: Add lastmod based on Git History #7742"
- 2025-11-11T11:55:15Z @tobiu closed this issue

