Showing commit history on posts
Thanks to Tom Critchlow, I recently found out about Ryan Duffy's blog post detailing how he added commit history to the posts on his Jekyll-powered site. I recently discussed a similar idea with Jon Borichevskiy and decided to adapt Ryan's method to my Gridsome-powered site.
To do this, I added a
CommitHistory component, which takes a
path as a prop; the path is then concatenated with the base path and a request is made to the GitHub commits
Post.vue template file, I then have a
path computed property that determines the path in the repository of the current post, and sends that to the
Nothing fancy, but a fun little feature to add to my site. Of course, since most of my posts are recently imported from WordPress, they'll almost all have a commit message of
add a ton of stuff? ¯\_(ツ)_/¯. All the more reason to write more!