From 3874b2fd1f7bd2374ce0c96bcb30be4aec5ad7f5 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 26 Jan 2026 08:00:15 +1000 Subject: [PATCH] Add footer details --- src/_data/build.js | 25 +++++++++++++++++++++++++ src/_includes/bio.njk | 2 ++ src/_includes/footer.njk | 39 +++++++++++++++++++++++++++++++++++++++ src/index.njk | 2 ++ 4 files changed, 68 insertions(+) create mode 100644 src/_data/build.js create mode 100644 src/_includes/footer.njk diff --git a/src/_data/build.js b/src/_data/build.js new file mode 100644 index 00000000..55cf1ba6 --- /dev/null +++ b/src/_data/build.js @@ -0,0 +1,25 @@ +const { execSync } = require('child_process'); + +module.exports = () => { + const now = new Date(); + + // Format the date: "Jan 26, 2026, 07:51 AM" + const timestamp = now.toLocaleString('en-US', { + dateStyle: 'medium', + timeStyle: 'short', + }); + + let gitHash = 'development'; + try { + // Get the short git hash (first 7 characters) + gitHash = execSync('git rev-parse --short HEAD').toString().trim(); + } catch (e) { + console.warn("Could not fetch git hash, defaulting to 'development'"); + } + + return { + timestamp, + hash: gitHash, + repoUrl: "https://github.com/NextCommunity/NextCommunity.github.io" + }; +}; diff --git a/src/_includes/bio.njk b/src/_includes/bio.njk index 1633a4d4..bb1c86ed 100644 --- a/src/_includes/bio.njk +++ b/src/_includes/bio.njk @@ -115,6 +115,8 @@ + {% include "footer.njk" %} +