ivantsepp / jekyll-git_metadata

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

Use this plugin on Github pages? Getting the data out of the last generated .json file? #20

Closed mvaneijgen closed 6 years ago

mvaneijgen commented 6 years ago

I wanted the show my latest commit hash on my site, so that I can make sure the files are correctly compiled by Github Pages, but running custom Jekyll plugins on there is not an option. Than I saw that there were JSON files created with each commit, so I thought that I could serve the data from there. The only thing I need is creating a static file inside a _data folder and have populate the contents with the latest version of the .json file inside the .git-metadata folder.

Is their a trick I'm missing or is this not that easy?

ivantsepp commented 6 years ago

You're absolutely right that Github Pages doesn't allow custom Jekyll plugins. The .git-metadata folder is for caching git results for this plugin.

I would recommend using https://github.com/jekyll/github-metadata since it's an official plugin and it seems to fit your use case with the build_revision attribute!