mirror of
https://github.com/CompeyDev/blog.devcomp.xyz.git
synced 2024-12-12 04:40:41 +00:00
Add git commit hash with link to footer component
This commit is contained in:
parent
a1aea63099
commit
675338a7bb
3 changed files with 15 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
|||
"prepare": "npmluau",
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro build && pagefind --site dist",
|
||||
"build": "COMMIT_HASH=`git rev-parse --short HEAD` astro build && pagefind --site dist",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro",
|
||||
"new-post": "lune run new-post",
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
---
|
||||
|
||||
import { profileConfig } from "../config";
|
||||
|
||||
const COMMIT_HASH = import.meta.env.COMMIT_HASH;
|
||||
const COMMIT_HASH_URL = COMMIT_HASH
|
||||
? `https://github.com/CompeyDev/blog.devcomp.xyz/commit/${COMMIT_HASH}`
|
||||
: null;
|
||||
---
|
||||
|
||||
<div class="card-base max-w-[var(--page-width)] min-h-[4.5rem] rounded-b-none mx-auto flex items-center px-6">
|
||||
<div class="transition text-50 text-sm">
|
||||
© 2024 {profileConfig.name}. All Rights Reserved.
|
||||
<br>
|
||||
Powered by <a class="link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/saicaca/fuwari">Fuwari</a>
|
||||
Powered by <a class="link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/saicaca/fuwari">Fuwari</a> - <a class="link text-[var(--primary)] font-medium" target="_blank" href={COMMIT_HASH_URL}>{COMMIT_HASH ?? "dev"}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
8
src/env.d.ts
vendored
8
src/env.d.ts
vendored
|
@ -1,2 +1,10 @@
|
|||
/// <reference types="astro/client" />
|
||||
/// <reference path="../.astro/types.d.ts" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly COMMIT_HASH?: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue