Skip to content

Commit bb63fcd

Browse files
jhfclaude
andcommitted
feat: Show Statbus version in footer with link to GitHub commit
Short hash displayed, full SHA used for the GitHub commit link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e4bed9f commit bb63fcd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

app/next.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ if (!process.env.DEBUG_STATUS_REPORTED) {
4141
/** @type {import('next').NextConfig} */
4242
const nextConfig = {
4343
reactStrictMode: true,
44+
env: {
45+
NEXT_PUBLIC_STATBUS_VERSION: process.env.VERSION || 'dev',
46+
NEXT_PUBLIC_STATBUS_VERSION_SHA: (() => {
47+
try {
48+
return require('child_process').execSync('git rev-parse HEAD').toString().trim();
49+
} catch {
50+
return '';
51+
}
52+
})(),
53+
},
4454
// output: 'standalone' is primarily for production builds.
4555
// Set it conditionally to avoid potential interference with dev server features like proxying.
4656
...(isDevelopment && {

app/src/components/footer.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ export default function Footer() {
4949
<Link href="https://www.statbus.org" aria-label="Statbus homepage">
5050
<Globe size={22} className="stroke-ssb-neon" />
5151
</Link>
52+
<span className="text-xs text-gray-300">
53+
Statbus version{" "}
54+
<Link
55+
href={`https://github.com/statisticsnorway/statbus/commit/${process.env.NEXT_PUBLIC_STATBUS_VERSION_SHA}`}
56+
className="hover:text-ssb-neon underline"
57+
>
58+
{process.env.NEXT_PUBLIC_STATBUS_VERSION}
59+
</Link>
60+
</span>
5261
</div>
5362
{/* Only render CommandPaletteTriggerButton if mounted, not loading, and authenticated */}
5463
{showAuthenticatedLayout && (

0 commit comments

Comments
 (0)