ivantsepp / jekyll-git_metadata

Expose Git metadata to Jekyll.
MIT License
67 stars 25 forks source link

Get last commit of any file #19

Open Booligoosh opened 7 years ago

Booligoosh commented 7 years ago

Hi, is it possible to do the effect of page.git.last_commit but with any file (not necessarily the one you are on)?

For example something like

{% for file in site.static_files %}

console.log("FILE {{file.path}} LAST COMMIT: {{file.git.last_commit.short_sha}}");

{% endfor %}

This works for files with front-matter but not images, XML files etc.

ivantsepp commented 7 years ago

Hello! 👋

There isn't functionality to get git data for static files but that's a great idea and I think we should do it. I welcome any pull requests for this functionality!