Rework commit info display in footer (#277)

* 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
This commit is contained in:
Glenn Feunteun
2020-03-18 20:33:04 +01:00
committed by GitHub
parent bba24e0bbd
commit 17fe8de72b
2 changed files with 4 additions and 2 deletions

View File

@@ -16,8 +16,9 @@
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
{{ end }}
{{ if .Site.Params.commit }}
{{ if or (not .Site.Params.hideCredits) (not .Site.Params.hideCopyright) }} · {{ end }}
[<a href="{{ .Site.Params.commit }}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]
{{ if .GitInfo }}
[<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
{{ end }}
{{ end }}
</section>
</footer>