diff --git a/package.json b/package.json index 8ef3aa5..3d509c8 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "node": ">=22.12.0" }, "scripts": { - "dev": "astro dev", + "dev": "PUBLIC_GIT_COMMIT=$(git rev-parse HEAD) astro dev", "preview": "astro preview", "astro": "astro", - "build": "astro build" + "build": "PUBLIC_GIT_COMMIT=$(git rev-parse HEAD) astro build" }, "dependencies": { "@astrojs/rss": "^4.0.17", diff --git a/public/images/email.svg b/public/images/email.svg new file mode 100644 index 0000000..cd78d4f --- /dev/null +++ b/public/images/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/github-outline-7.svg b/public/images/github-outline-7.svg new file mode 100644 index 0000000..2ab205c --- /dev/null +++ b/public/images/github-outline-7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/BuildHashBlocks.astro b/src/components/BuildHashBlocks.astro new file mode 100644 index 0000000..5c0a4ac --- /dev/null +++ b/src/components/BuildHashBlocks.astro @@ -0,0 +1,47 @@ +--- +const rawHash = (import.meta.env.PUBLIC_GIT_COMMIT || "") + .replace(/[^a-fA-F0-9]/g, "") + .toLowerCase(); + +const safeHash = rawHash || "0000000000000000000000000000000000000000"; + +const blockCount = 6; +const hexPerBlock = 6; + +const blocks: string[] = Array.from({ length: blockCount }, (_, i) => { + const start = i * hexPerBlock; + const part = safeHash.slice(start, start + hexPerBlock).padEnd(6, "0"); + return `#${part}`; +}); +--- + +
+
Astro Build
+ { + blocks.map((color: string) => ( + + )) + } +
+ + diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 77908be..e9c459d 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,13 +1,31 @@ --- import { getLangFromUrl, getTranslations, type Lang } from "@/i18n"; - +import BuildHashBlocks from "@/components/BuildHashBlocks.astro"; +const commit = import.meta.env.PUBLIC_GIT_COMMIT || "unknown"; const lang = getLangFromUrl(Astro.url); const t = getTranslations(lang); --- + +