add commit hash to footer

* closes #5
This commit is contained in:
Matthias Kretschmann 2024-04-06 14:35:49 +01:00
parent 7fb3c95822
commit 979e2361fb
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 12 additions and 10 deletions

View File

@ -14,7 +14,7 @@
justify-content: space-between; justify-content: space-between;
} }
.footer a { .footer a:not(.commitHash) {
color: rgba(var(--foreground-rgb), 0.8); color: rgba(var(--foreground-rgb), 0.8);
} }

View File

@ -12,18 +12,20 @@ export function Footer() {
</span> </span>
<p className={styles.social}> <p className={styles.social}>
<a
className={styles.commitHash}
href={`${repoUrl}/commit/${process.env.GIT_COMMIT_SHA}`}
>
{process.env.GIT_COMMIT_SHA?.substring(0, 7)}
</a>
<a href={repoUrl}> <a href={repoUrl}>
<GitHubLogoIcon /> <GitHubLogoIcon />
</a> </a>
</p> </p>
</div> </div>
{/* <div> <div style={{ textAlign: 'right' }}>
<p> <p></p>
<a href={`${repoUrl}/commit/${process.env.VERCEL_GIT_COMMIT_SHA}`}> </div>
{process.env.VERCEL_GIT_COMMIT_SHA?.substring(0, 7)}
</a>
</p>
</div> */}
</footer> </footer>
) )
} }

View File

@ -3,8 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "export GIT_COMMIT_SHA=$(git rev-parse HEAD) && next dev",
"build": "next build", "build": "export GIT_COMMIT_SHA=$(git rev-parse HEAD) && next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",