WORK-087
ID:WORK-087Status:done

Add Sitemap lastmod Support Using File Timestamps

Priority:lowComplexity:simpleMilestone:v1.0.0Source:SPEC-029
changeset-release/main View source

Criteria completion

No incremental history — criteria tracking started on Apr 19.

Branches 2
changeset-release/main current done
main doneclaude/file-naming-convention-LJdwR done
History 7
  1. f2b3512
    Content editedby Claude
    Add {ID}-{slug}.md filename convention + migrate filenames subcommand
  2. 59ded4a
    Content editedby Claude
    Implement SPEC-037 plan package hardening: all 7 work items
  3. f262d7b
    Content editedby Claude
    Backfill source attributes on all 123 work items
  4. f0a845a
    Content editedby Claude
    chore(plan): check off acceptance criteria for 14 completed v1.0.0 work
  5. f87ae8d
    Content editedby Claude
    feat: implement file-derived timestamps for runes (SPEC-029)
  6. 2a05e00
    Content editedby Claude
    plan: assign WORK-083 through WORK-087 to milestone v1.0.0
  7. 43cadfe
    Created (done)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