# No more hand-edited dates

> Source: <https://zander.wtf/blog/2026-10-01-git-dates/>
> Published: 2026-10-01 00:00:00+00:00

# No more hand-edited dates

## A new package, astro-git-dates, sets a post or code note's date from its last commit at build time.

When I change a code note, I change its date too, or I ask Claude to do it. Now I don’t have to. A note with `date: git Last Modified` in its frontmatter gets the date of its last commit at build time, so I edit the note and the date follows. Blog posts can do the same, and `git Created` gives the date of the first commit. I had this on the old Eleventy site and missed it.

I couldn’t find an Astro plugin that did it, so I wrote one: [astro-git-dates](https://zander.wtf/projects/astro-git-dates). It wraps a content collection’s loader and swaps the keyword for a real date before the schema checks it. To use it, the blog and code notes had to move off the old `type: 'content'` collections and onto the `glob()` loader. That touched every page that used `entry.slug`, but the build makes exactly the same pages as before. I diffed the list to be sure.

It’s opt-in per note, so nothing changed date in bulk. I’ll switch notes over as I edit them.
