diff --git a/next.config.js b/next.config.js index 9fbe0752..3409d497 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,19 @@ const WindiCSSWebpackPlugin = require("windicss-webpack-plugin"); +const childProcess = require("child_process"); + +let currentCommit; +try { + currentCommit = childProcess.execSync("git rev-parse HEAD").toString().slice(0, 7).trim(); +} catch (error) { + console.error("Failed to get the current commit:", error); + currentCommit = "unknown"; +} /** @type {import('next').NextConfig} */ const nextConfig = { + env: { + CURRENT_COMMIT: currentCommit + }, reactStrictMode: true, webpack: (config) => { config.plugins.push(new WindiCSSWebpackPlugin()); @@ -19,4 +31,4 @@ const nextConfig = { }, }; -module.exports = nextConfig; +module.exports = nextConfig; \ No newline at end of file diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index f343ebcc..d4840ad9 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -119,9 +119,26 @@ const Footer = () => (