From 17fe8de72b97d0b91143afbb7b08b610292166d3 Mon Sep 17 00:00:00 2001 From: Glenn Feunteun Date: Wed, 18 Mar 2020 20:33:04 +0100 Subject: [PATCH] Rework commit info display in footer (#277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rework commit info display in footer Use Hugo .GitInfo to get Hash and AbbreviatedHash Remove leading · because it renders as .· when credits are displayed * Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + layouts/partials/footer.html | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c949275..0ce358d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -60,3 +60,4 @@ - [Paolo Mainardi](https://paolomainardi.com) - [Ka-Wai Lin](https://github.com/kwlin) - [Piotr Orzechowski](https://orzechowski.tech) +- [Glenn Feunteun](https://github.com/gfeun) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1677656..6c2d72c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -16,8 +16,9 @@ {{ i18n "powered_by" }} Hugo & Coder. {{ end }} {{ if .Site.Params.commit }} - {{ if or (not .Site.Params.hideCredits) (not .Site.Params.hideCopyright) }} · {{ end }} - [{{ getenv "GIT_COMMIT_SHA_SHORT" }}] + {{ if .GitInfo }} + [{{ .GitInfo.AbbreviatedHash }}] + {{ end }} {{ end }}