From 2a9b72d2ac0250b677aa16791ef16ffae859c7bd Mon Sep 17 00:00:00 2001 From: Dale Noe Date: Sat, 13 Oct 2018 13:56:45 -0500 Subject: [PATCH] Adding the ability to have git commit hash in the footer (#78) * Adding the ability to have git commit hash in the footer * making changes as discussed in GH-78 * last changes before merge * removed lines that are not needed * fixing duplicate * Last changes hopefully --- exampleSite/config.toml | 3 +++ layouts/partials/footer.html | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b132437..b6cd3a4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -27,6 +27,9 @@ disqusShortname = "yourdiscussshortname" hideCredits = false hideCopyright = false + # Git Commit in Footer, uncomment the line below to enable it. + commit = "https://github.com/luizdepra/hugo-coder/tree/" + rtl = false # Custom CSS diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f88c0d1..7abffa5 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,6 +3,14 @@ {{ with .Site.Params.footercontent }}

{{.}}

{{ end }} - {{ if not .Site.Params.hideCopyright }} © {{ .Site.LastChange.Format "2006" }} {{ end }} {{ if not .Site.Params.hideCredits}} {{ if not .Site.Params.hideCopyright }} · {{ end }} Powered by Hugo & Coder. {{ end }} + {{ if not .Site.Params.hideCopyright }} © {{ .Site.LastChange.Format "2006" }}{{ end }} + {{ if not .Site.Params.hideCredits }} + {{ if not .Site.Params.hideCopyright }} · {{ end }} + 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" }}] + {{ end }}