feat: show commit SHA in footer with link to repo commit
Build & Push Portfolio Image / build-push (push) Successful in 2m42s

This commit is contained in:
Story Crater Bot
2026-09-01 17:03:37 -07:00
parent a10f5454cd
commit aa67c4551d
2 changed files with 18 additions and 1 deletions
+10
View File
@@ -140,6 +140,16 @@ export default function Home() {
{t.footer.email}
</a>
</p>
<p className="mt-2 font-mono text-xs text-gray-400 dark:text-gray-500">
<a
href={`https://forgejo.riotpiao.com/rock/riotpiao.com/commit/${process.env.NEXT_PUBLIC_COMMIT_SHA}`}
target="_blank"
rel="noopener noreferrer"
className="hover:text-blue-600 dark:hover:text-blue-400"
>
{process.env.NEXT_PUBLIC_COMMIT_SHA}
</a>
</p>
</div>
</footer>
+8 -1
View File
@@ -1,7 +1,14 @@
const { execSync } = require('child_process');
const commitSha = process.env.COMMIT_SHA
|| (() => { try { return execSync('git rev-parse --short HEAD').toString().trim(); } catch { return 'dev'; } })();
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
env: {
NEXT_PUBLIC_COMMIT_SHA: commitSha,
},
};
module.exports = nextConfig;
// trigger ci 2026年 8月31日 星期一 17时28分38秒 PDT