ID:WORK-087Status:done
Add Sitemap lastmod Support Using File Timestamps
Priority:lowComplexity:simpleMilestone:v1.0.0Source:SPEC-029
Summary
The sitemap generator in packages/content/src/sitemap.ts currently emits no <lastmod> tags. With $file.modified available in the content pipeline, sitemap generation can include <lastmod> for each page, helping search engines prioritize crawl frequency.
Acceptance Criteria
- Sitemap XML output includes
<lastmod>elements for pages that have afile.modifiedvalue <lastmod>uses ISO 8601 date format (YYYY-MM-DD)- Pages without a modification date omit
<lastmod>rather than emitting an empty element - Existing sitemap output structure (URL, priority, changefreq if present) is unaffected
- Test verifying
<lastmod>appears in sitemap output when file timestamps are available
Approach
- In
packages/content/src/sitemap.ts, readfile.modifiedfrom page data during serialization - Emit
<lastmod>element within the<url>block when the value is present - Add test case
References
- File-Derived Timestamps for Runes (Broader Impact — Sitemap)
- Inject $file.created and $file.modified Variables into Content Pipeline (variable injection — dependency)
packages/content/src/sitemap.ts— sitemap generator
Relationships
History
- 59ded4aContent edited
- f262d7bsource+SPEC-029
- f0a845a
- ☑ Sitemap XML output includes `<lastmod>` elements for pages that have a `file.modified` value
- ☑ `<lastmod>` uses ISO 8601 date format (`YYYY-MM-DD`)
- ☑ Pages without a modification date omit `<lastmod>` rather than emitting an empty element
- +2 more criteria
- f87ae8dstatusready→done
- 2a05e00milestone+v1.0.0
- 43cadfeCreated (ready, low, simple, content, seo)