Skip to content

How to use last_modified hook #6

Answered by kungfux
groundedtako asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @groundedtako

The last modified hook is a part of the Chirpy Starter. It checks the post history in Git to set the post.data['last_modified_at'] value. So when you make changes to the post and commit changes to Git, the post will show up as modified.

The hook does not modify or add the last_modified_at in the front matter for a post, but you can add it manually. If last_modified_at is defined in the front matter, then the hook has no effect. So if I define it manually in the front matter, I have manual control over the last modified date.

---
date: 2024-06-23 07:33:12 +0400
last_modified_at: 2024-06-23 07:33:12 +0400
---

Here is why I do this. I don't want the post to be marked as m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by groundedtako
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants