Git Last Modified front matter attribute not respected with 11ty

Hi!

I’m hoping this is a reasonably simple one. I’m using CF pages with Eleventy and came across a date option for “git last modified”, which shows the date when a particular file is modified in Git. I can build locally and the different dates individual articles are updated are shown correctly, but when building via Pages with automatic deployments, every file shows the updated date as the date Pages built the site.

I really don’t want to maintain last-updated fields for all of my posts manually, so if there’s a solution for this I’m all ears.

Thanks!

1 Like

To follow up, seems like suggestions elsewhere point to CF doing shallow git clone. Is there a means of requiring a full clone, or at least X levels deep?

2 Likes

same issue and solved by concatenating git fetch --unshallow && onto the build command

5 Likes