From 13ce308657991603416478b8ad87cbf0bf41ba17 Mon Sep 17 00:00:00 2001 From: David Eisinger Date: Mon, 9 Dec 2024 04:23:24 -0500 Subject: [PATCH] Change how we get git info --- .build.yml | 11 ++++++----- bin/get-last-commit.sh | 6 ------ themes/v2/layouts/partials/footer.html | 4 ++-- 3 files changed, 8 insertions(+), 13 deletions(-) delete mode 100755 bin/get-last-commit.sh diff --git a/.build.yml b/.build.yml index b4400d2..fc46484 100644 --- a/.build.yml +++ b/.build.yml @@ -26,9 +26,9 @@ tasks: npx cspell "content/**/*.md" - rss: | curl -s https://raw.githubusercontent.com/gohugoio/hugo/refs/tags/v$HUGO_VERSION/tpl/tplimpl/embedded/templates/_default/rss.xml \ - | diff - ./themes/v2/layouts/_default/rss.xml \ - | wc -l \ - | grep 7 + | diff - ./themes/v2/layouts/_default/rss.xml \ + | wc -l \ + | grep 7 - dither: | cd bin/dither sudo bundle install @@ -36,8 +36,9 @@ tasks: KEY=~/secret.key \ bundle exec rackup -p 4567 -D - hugo: | - source bin/get-last-commit.sh - DITHER_SERVER=http://localhost:4567 hugo --minify + HUGO_PARAMS_GIT_COMMIT=$(git rev-parse HEAD) \ + DITHER_SERVER=http://localhost:4567 \ + hugo --minify find public -name "*.enc" -type f -delete - deploy: | if [ "$(git rev-parse main)" != "$(git rev-parse HEAD)" ]; then \ diff --git a/bin/get-last-commit.sh b/bin/get-last-commit.sh deleted file mode 100755 index 17dd6c9..0000000 --- a/bin/get-last-commit.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -export HUGOxPARAMSxGITxLAST_COMMITxAUTHORNAME=$(git log -1 --format=%an) -export HUGOxPARAMSxGITxLAST_COMMITxDATE=$(git log -1 --format=%cI) -export HUGOxPARAMSxGITxLAST_COMMITxHASH=$(git log -1 --format=%H) -export HUGOxPARAMSxGITxLAST_COMMITxSUBJECT=$(git log -1 --format=%s) diff --git a/themes/v2/layouts/partials/footer.html b/themes/v2/layouts/partials/footer.html index 7787dac..07b0924 100644 --- a/themes/v2/layouts/partials/footer.html +++ b/themes/v2/layouts/partials/footer.html @@ -11,8 +11,8 @@
Rendered {{ now | dateFormat "2006-01-02 15:04:05 MST" }} - {{ with site.Params.git.last_commit }} - • {{ substr .hash 0 7}} + {{ with site.Params.git.commit }} + • {{ substr . 0 7}} {{ end }}