Expose the git commit id in website


#1

Is it possible to expose/append a full git commit ID in a Jekyll website on GitHub Pages? Similar to the sbt-buildinfo plugin for Scala-powered websites.

It should look like this at the end of the website source code (e.g. membership.theguardian.com):

<!-- build-commit-id: 370fa99f0cf1a2acc8b273a37d359e3a43b084e1 -->

I found this old plugin on GitHub for self-hosted usage but this doesn’t work for GitHub Pages and it uses short git commit IDs.


PS: I want to implement this in my Jekyll website:


#2

have you seen
https://help.github.com/articles/repository-metadata-on-github-pages/

maybe build version?


#3

Thanks but it doesn’t display the git commit rev id in the website source code (https://github.com/suriyaakudo/cdn.suriyaa.tk/blob/gh-pages/_layouts/default.html#L14) at https://cdn.suriyaa.tk/.


#4

You have to configure the target repo in _config.yml :

repository: suriyaakudo/cdn.suriyaa.tk 

See jekyll-github-metadata documentation


#5