Add commit url meta attribute

pull/3273/head
Kamran Ahmed 2 years ago
parent 88ff836bfb
commit 2c18529429
  1. 8
      src/env.d.ts
  2. 5
      src/layouts/BaseLayout.astro

8
src/env.d.ts vendored

@ -1 +1,9 @@
/// <reference types="astro/client" />
interface ImportMetaEnv {
GITHUB_SHA: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}

@ -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
}`;
---
<!DOCTYPE html>
@ -39,6 +43,7 @@ const currentPageAbsoluteUrl = `https://roadmap.sh${permalink.replace(
<head>
<meta charset='UTF-8' />
<meta name='generator' content={Astro.generator} />
<meta name='sha' content={commitUrl} />
<title>{title}</title>
<meta name='description' content={description} />
<meta name='author' content='Kamran Ahmed' />

Loading…
Cancel
Save