Magalie Chetrit

Available for hire, let's talk!
Back to home

How to get the latest Git commit date using 11ty

Date posted:

Date modified:

An archive piece for my future self

I would say I am a medior when it comes to JavaScript, SPG and CI/CD. As I am self taught, I am still searching for the best way to do things. Especially, when it comes with folder structure. But as with everything coding, baby steps.

For a while I have wanted to have the date in the footer of my site to be the latest commit date. I couldn't figure out how to do it from the 11ty documentation. In the documentation it states to use git Last Modified or git Created. In my current configuration this would return "Invalid Datetime".

Search trail references:

The solution: Make my own shortcode

After actually reading the articles, I figured out that I could make my own shortcode.