WORK-087
ID:WORK-087Status:done

Add Sitemap lastmod Support Using File Timestamps

Priority:lowComplexity:simpleMilestone:v1.0.0Source:SPEC-029

Criteria completion

Criteria completion: 5 of 5 (100%) checked; history from Mar 30 to Apr 30%25%50%75%100%Mar 30Apr 3
Branches 2
History 6
  1. e900a90
    Created (done)by bjornolofandersson
  2. f262d7b
    Content editedby Claude
  3. 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
    • ☑ Existing sitemap output structure (URL, priority, changefreq if present) is unaffected
    • ☑ Test verifying `<lastmod>` appears in sitemap output when file timestamps are available
    by Claude
  4. f87ae8d
    statusreadydone
    by Claude
  5. 2a05e00
    Content editedby Claude
  6. 43cadfe
    Created (ready)by Claude
    plan: break down SPEC-029 into work items WORK-083 through WORK-087

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 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
  • Existing sitemap output structure (URL, priority, changefreq if present) is unaffected
  • Test verifying <lastmod> appears in sitemap output when file timestamps are available

Approach

  1. In packages/content/src/sitemap.ts, read file.modified from page data during serialization
  2. Emit <lastmod> element within the <url> block when the value is present
  3. Add test case

References

  • SPEC-029 (Broader Impact — Sitemap)
  • WORK-084 (variable injection — dependency)
  • packages/content/src/sitemap.ts — sitemap generator