fix: hide SHA when unavailable (show CI fallback), Home scrolls to top
Build & Push Portfolio Image / build-push (push) Successful in 3m29s

This commit is contained in:
Story Crater Bot
2026-09-02 10:32:11 -07:00
parent 7e8d6c3afa
commit 406f0db52d
3 changed files with 15 additions and 14 deletions
+12 -8
View File
@@ -77,14 +77,18 @@ export function CIStatusIndicator() {
className={`flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/90 dark:bg-gray-900/90 backdrop-blur-sm border border-gray-200 dark:border-gray-700 shadow-sm ${getStatusColor()}`}
>
<GitBranch size={14} className="text-gray-500 dark:text-gray-400" />
<a
href={`https://forgejo.riotpiao.com/rock/riotpiao.com/commit/${process.env.NEXT_PUBLIC_COMMIT_SHA}`}
target="_blank"
rel="noopener noreferrer"
className="text-xs font-mono font-medium text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400"
>
{process.env.NEXT_PUBLIC_COMMIT_SHA || 'dev'}
</a>
{process.env.NEXT_PUBLIC_COMMIT_SHA ? (
<a
href={`https://forgejo.riotpiao.com/rock/riotpiao.com/commit/${process.env.NEXT_PUBLIC_COMMIT_SHA}`}
target="_blank"
rel="noopener noreferrer"
className="text-xs font-mono font-medium text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400"
>
{process.env.NEXT_PUBLIC_COMMIT_SHA}
</a>
) : (
<span className="text-xs font-medium text-gray-600 dark:text-gray-300">CI</span>
)}
<div className={`flex items-center gap-1 ${getStatusColor()}`}>
{getStatusIcon()}
<span className="text-xs font-semibold">{getStatusText()}</span>
+2 -2
View File
@@ -60,7 +60,7 @@ export default function Header() {
</Link>
<nav className="hidden md:flex gap-8 items-center">
<Link href="/" className="text-sm hover:text-blue-600 dark:hover:text-blue-400">{t.header.nav.home}</Link>
<button onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })} className="text-sm hover:text-blue-600 dark:hover:text-blue-400">{t.header.nav.home}</button>
<button
onClick={() => setTerminalOpen(!terminalOpen)}
className="text-sm hover:text-blue-600 dark:hover:text-blue-400"
@@ -239,7 +239,7 @@ export default function Header() {
{open && (
<div className="md:hidden border-t border-gray-200 dark:border-gray-800 p-4 space-y-4">
<Link href="/" className="block py-2 text-sm hover:text-blue-600">{t.header.nav.home}</Link>
<button onClick={() => { setOpen(false); window.scrollTo({ top: 0, behavior: 'smooth' }); }} className="block py-2 text-sm hover:text-blue-600">{t.header.nav.home}</button>
<button
onClick={() => setTerminalOpen(!terminalOpen)}
className="block py-2 text-sm hover:text-blue-600"
+1 -4
View File
@@ -1,7 +1,4 @@
const { execSync } = require('child_process');
const commitSha = process.env.COMMIT_SHA
|| (() => { try { return execSync('git rev-parse --short HEAD').toString().trim(); } catch { return 'dev'; } })();
const commitSha = process.env.COMMIT_SHA || '';
/** @type {import('next').NextConfig} */
const nextConfig = {