From 2c185294290b5589cc12e79e9a3f711e68799f75 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sun, 8 Jan 2023 06:38:50 +0400 Subject: [PATCH] Add commit url meta attribute --- src/env.d.ts | 8 ++++++++ src/layouts/BaseLayout.astro | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/env.d.ts b/src/env.d.ts index f964fe0cf..db53e77f0 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1 +1,9 @@ /// + +interface ImportMetaEnv { + GITHUB_SHA: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 62ae93dc4..77ff5e5ea 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -32,6 +32,10 @@ const currentPageAbsoluteUrl = `https://roadmap.sh${permalink.replace( /\/$/, '' )}`; + +const commitUrl = `https://github.com/kamranahmedse/developer-roadmap/commit/${ + import.meta.env.GITHUB_SHA +}`; --- @@ -39,6 +43,7 @@ const currentPageAbsoluteUrl = `https://roadmap.sh${permalink.replace( + {title}