From 599a07e6c0157353744ad3326d019a488a90e854 Mon Sep 17 00:00:00 2001 From: Aria Date: Mon, 10 Mar 2025 20:43:23 +1100 Subject: [PATCH] Add auto linking to current git commit --- .env.example | 1 + README.md | 6 ++++++ src/components/Footer.astro | 13 ++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..de7a7c2 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +PUBLIC_REPOURL=https://github.com/BuyMyMojo/aria.coffee/ \ No newline at end of file diff --git a/README.md b/README.md index 0e7ce26..e6a8e54 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Wowie what a gay little website for my gay little self +## Setup + +You must create a `.env` file with the contents of `.env.example` and set the URL of your repo for the commit footer. + +Example URL: `https://github.com/BuyMyMojo/aria.coffee/` - Notice the trailing `/`, this is required + ## Deploy steps (Pre-rendered website) On dev machine: diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 0da6d63..1e77a60 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -2,17 +2,20 @@ const buttonFormat = "gif"; import { Icon } from "astro-icon/components"; +import { execSync } from "node:child_process"; + +const commitURL = `${import.meta.env.PUBLIC_REPOURL}commit/${execSync(`git log -1 --pretty="format:%H"`)}`; ---