From f4c2e0b0e0bbffcf490a4ad5493af1515e2ae06a Mon Sep 17 00:00:00 2001
From: Aaron Powell
Date: Tue, 3 Feb 2026 10:38:16 +1100
Subject: [PATCH] Add commit SHA and build date to website footer
- Display short commit SHA with link to GitHub commit
- Show build date in YYYY-MM-DD format
- Use GITHUB_SHA env var in CI, fallback to git command locally
- Add subtle styling for build info text
---
website/public/styles/global.css | 6 ++++++
website/src/layouts/BaseLayout.astro | 24 ++++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/website/public/styles/global.css b/website/public/styles/global.css
index 81f598c7..ddd77c9c 100644
--- a/website/public/styles/global.css
+++ b/website/public/styles/global.css
@@ -688,6 +688,12 @@ a:hover {
color: var(--color-accent);
}
+.site-footer .build-info {
+ margin-top: 8px;
+ font-size: 12px;
+ opacity: 0.7;
+}
+
/* Buttons */
.btn {
display: inline-flex;
diff --git a/website/src/layouts/BaseLayout.astro b/website/src/layouts/BaseLayout.astro
index a8bc2b5c..74ebf201 100644
--- a/website/src/layouts/BaseLayout.astro
+++ b/website/src/layouts/BaseLayout.astro
@@ -1,4 +1,6 @@
---
+import { execSync } from "child_process";
+
interface Props {
title: string;
description?: string;
@@ -11,6 +13,21 @@ const {
activeNav = "",
} = Astro.props;
const base = import.meta.env.BASE_URL;
+
+// Get git commit SHA and build date at build time
+let commitSha = "unknown";
+let buildDate = new Date().toISOString().split("T")[0];
+try {
+ // Use GITHUB_SHA env var in GitHub Actions, fallback to git command locally
+ const githubSha = process.env.GITHUB_SHA;
+ if (githubSha) {
+ commitSha = githubSha.substring(0, 7);
+ } else {
+ commitSha = execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim();
+ }
+} catch {
+ // Fallback if git is not available
+}
---
@@ -155,6 +172,13 @@ const base = import.meta.env.BASE_URL;
rel="noopener">MIT License
+
+ Built from {commitSha} on {buildDate}
+