From 025acf1b61b968c5e4d426949b192c3c0ab387a6 Mon Sep 17 00:00:00 2001
From: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Date: Thu, 18 May 2023 11:22:31 +0800
Subject: feat: add git commit in footer
---
src/layouts/Base.astro | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'src')
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
index 2e5b480..29f95ab 100644
--- a/src/layouts/Base.astro
+++ b/src/layouts/Base.astro
@@ -2,8 +2,12 @@
import Head from "@components/Head.astro";
import Nav from "@components/Nav.astro";
// import Footer from "@components/Footer.astro";
+import { execa } from "execa";
import "@styles/global.sass";
+
const { title, description } = Astro.props;
+
+const { stdout: gitCommit } = await execa("git", ["rev-parse", "HEAD"]);
---
@@ -14,5 +18,8 @@ const { title, description } = Astro.props;
{gitCommit}
+