List of last N git commits touching a content page

Continuing the discussion from Adding a "last updated" page with the latest changes [on doc]:

This discussion made me think if it would be useful for .GitInfo to have more information, like a list of last N commits that touched a content file (say /posts/post1.md). For folks (like me) that like linking to the Markdown source of the posts, it would be nice to see how the post evolved through the last N commits.

The N would be a Site Param. If not, at least be a number like 10. User can then range through that list to show the last 10 (or any smaller number) commits.

  • Would this feature be useful to others?
  • Is it easy to implement?
  • Would get git log of last N vs just the last (as we do now) cause any visible performance issue?

It is hard to implement a version that would not kill performance. And it doesn’t sound like something Hugo should mess with.

We wanted to do the same thing for a docs site, but ended up just templating a link to the log view in GitLab for any given page. Gotta keep that speed! :slight_smile: