Skip to content

feat: auto-update last_modified in dev server and add freshness test#3011

Open
bartlomieju wants to merge 1 commit intomainfrom
auto-update-last-modified
Open

feat: auto-update last_modified in dev server and add freshness test#3011
bartlomieju wants to merge 1 commit intomainfrom
auto-update-last-modified

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Adds a beforeUpdate event listener in the dev server that automatically updates the last_modified frontmatter field to today's date whenever a markdown page is edited during deno task dev
  • Adds a new test that validates all last_modified dates are valid YYYY-MM-DD, not in the future, and match the last content-change date in git history (using git log -G to skip metadata-only commits)

Test plan

  • Run deno test -A frontmatter_test.ts — all 512 steps should pass
  • Run deno task dev, edit a markdown file, and verify the last_modified field is updated to today's date
  • Verify no infinite loop: the second watcher trigger should be a no-op since the date already matches

🤖 Generated with Claude Code

The dev server now automatically updates the `last_modified` frontmatter
field to today's date when a markdown page is edited, keeping timestamps
in sync without manual effort. Also adds a test that validates all
`last_modified` dates are well-formed and match git history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant