scttwillsey

Astro Sitemap Page Modified Timestamps

Threads generally makes me sad by being social media, so I don’t look at it often. Imagine my surprise today when I was wading through some hostile replies to my thoughts about an F1 related topic and I stumbled across a comment to me about my post on Using Git Hooks for Displaying Last Modified Dates and how to apply it to Astro Sitemap.

Post by @zaitovalisher
View on Threads

Interesting question. I guess the approach would be to first use pre-commit to modify the timestamps on any pages updated in the commit and then modify the sitemap file by looking for any pages with date modified timestamps and updating their entries in the sitemap.

There is a serialize function in Astro Sitemap and it looks like it happens on build when writing out the sitemap. If this is true, so long as you do your git commit before you do your build, it should update the pages with the correct last modified dates.

Now I’m going to have to play with Astro Sitemap and find out!

Latest Posts

Browse all posts
  1. Claude Brew-Vetting-Skill

    Fear and loathing of package supply chains, now applied to Homebrew: a Claude Code skill that vets updates before you install them.

  2. MikanMessage — a Display Message Action for Apple Shortcuts

    Introducing MikanMessage — A Display Message action for Apple Shortcuts

  3. The Great npm Purge of 2026

    No more node_modules: moving my sites from Astro to Zola, and letting Claude do the heavy lifting.