aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/shared/BaseHead.astro
diff options
context:
space:
mode:
Diffstat (limited to 'apps/website/src/components/shared/BaseHead.astro')
-rw-r--r--apps/website/src/components/shared/BaseHead.astro51
1 files changed, 48 insertions, 3 deletions
diff --git a/apps/website/src/components/shared/BaseHead.astro b/apps/website/src/components/shared/BaseHead.astro
index bfe8f78..39e98a7 100644
--- a/apps/website/src/components/shared/BaseHead.astro
+++ b/apps/website/src/components/shared/BaseHead.astro
@@ -1,12 +1,57 @@
---
+import smartypants from 'smartypants';
+import siteInfo from '../../data/site-info';
+import SEO from './SEO.astro';
+import Favicon from '/media/polyfrost/minimal_bg.svg?url';
+
export type Props = {
- siteName: string;
title?: string;
- description: string;
- image: { src: string; alt: string };
+ description?: string;
+ image?: { src: string; alt: string };
canonicalURL?: URL | null;
pageType?: 'website' | 'article';
};
const twitterHandle = 'polyfrost';
+
+const {
+ description = siteInfo.description,
+ image = siteInfo.image,
+ canonicalURL = new URL(Astro.request.url, Astro.site),
+ pageType = 'website',
+} = Astro.props;
+
+const title = [Astro.props.title, siteInfo.name].filter(Boolean).join(' | ');
+const resolvedImage = {
+ src: new URL(image.src, Astro.site).toString(),
+ alt: image.alt,
+};
---
+
+<!-- High Priority Global Metadata -->
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width" />
+<title set:html={smartypants(title, 1)} />
+<meta name="generator" content={Astro.generator} />
+
+<!-- Font Preloads -->
+<link rel="preconnect" href="https://fonts.googleapis.com"/>
+<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
+<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"/>
+<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital@0;1&display=swap" rel="stylesheet"/>
+
+<!-- Low Priority Global Metadata -->
+<link rel="icon" type="image/svg+xml" href={Favicon}/>
+<link rel="sitemap" href="/sitemap-index.xml" />
+<link rel="mask-icon" href="/media/polyfrost/minimal_bg.svg" />
+<link rel="alternate" type="application/rss+xml" href="/rss.xml" title="RSS" />
+
+<SEO
+ name={siteInfo.name}
+ title={title}
+ description={description}
+ image={resolvedImage}
+ twitter={{ handle: twitterHandle }}
+ og={{ type: pageType }}
+ canonicalURL={canonicalURL}
+/>