What a content date actually is

Published

Notes

Once you accept that lastmod must reflect real content change, the next question is where that date comes from. Three tempting sources all fail.

File modification time changes on checkout. A fresh clone in CI gives every file the same mtime, which reproduces the original defect with extra steps.

Git history is closer to the truth, but build environments routinely perform shallow clones, so the commit that last touched a given file is often simply absent from the build container. A lookup that silently returns nothing is worse than no lookup.

The build clock is not a content date under any circumstances.

That leaves declaring the date alongside the content, which is what this site does. Static routes carry a hand-maintained map; posts carry a published field. Both are stable across builds, both are reviewable in a diff, and neither can quietly drift to today.

More

Back to the blog index.