From ca19ee452b6561325943847246f4aaf9f59d3efa Mon Sep 17 00:00:00 2001 From: Marco Galster Date: Mon, 21 Nov 2022 23:51:57 +0100 Subject: [PATCH] =?UTF-8?q?Letzte=20=C3=84nderung=20und=20Git-Commit=20im?= =?UTF-8?q?=20Footer=20mit=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ layouts/partials/footer.html | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 1c88307..6ec5433 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ theme = "BlogAMore" author = "Beispiel Autor" description = "Eine Beschreibung des Autors, als kurze Zusammenfassung" + # Dateiname der den aktuellen Commit-Hash entält, sowie die Basis-url des Repo, damit im Footer der aktuelle Hash angezeigt wird, die Datei muss dann am besten über das Published-Script erzeugt werden + gitHashFile = "commit_id.txt" + gitRepoUrl = "http://example.com" + # Zusätzliche CSS und JS-Dateien custom_css = [] custom_js = [] diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index fd374df..690292e 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -6,5 +6,19 @@ {{ end }} +

+ {{ if (and (isset .Site.Params "githashfile") (isset .Site.Params "gitrepourl")) }} + {{ if (fileExists .Site.Params.gitHashFile) }} + {{ $commit_id := trim (readFile .Site.Params.gitHashFile) "\n" }} + Git commit: + {{- substr $commit_id 0 7 -}} + + {{ end }} + {{ end }} + Updated on {{ now.Format "January 2, 2006" }} +

+

© 2009-{{ now.Format "2006"}} MarcoDN