fix: hide SHA when unavailable (show CI fallback), Home scrolls to top
Build & Push Portfolio Image / build-push (push) Successful in 3m29s
Build & Push Portfolio Image / build-push (push) Successful in 3m29s
This commit is contained in:
@@ -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" />
|
||||
{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 || 'dev'}
|
||||
{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>
|
||||
|
||||
@@ -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
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user