aboutsummaryrefslogtreecommitdiff
path: root/src/components/Head.astro
blob: 3fded952f770e784de70afc88a1c7cb71353cd05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
import type { WithContext, Thing } from "schema-dts";
import JsonLd from "./JsonLd.astro";

type Props = {
	readonly description: string;
	readonly preview: string;
	readonly schema: WithContext<Thing>;
	readonly title: string;
};

const { description, preview, schema, title } = Astro.props;

const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
const previewUrl = new URL(preview, Astro.site);
---

<head>
	<!-- Meta Tags -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />

	<meta name="description" content={description} />
	<meta name="robots" content="index, follow" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<link href="/feed.xml" rel="alternate" title="RSS" type="application/atom+xml" />
	<link href="/sitemap-index.xml" rel="sitemap" />
	<link href={canonicalUrl} rel="canonical" />

	<title>{title}</title>

	<!-- Icons -->
	<link rel="icon" type="image/x-icon" href="/favicon.ico" />
	<link rel="icon" type="image/png" href="/favicon.png" />
	<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
	<link rel="manifest" href="/manifest.json" />
	<meta name="theme-color" content="#ffffff" />

	<!-- Open Graph -->
	<meta property="og:type" content="website" />
	<meta property="og:title" content={title} />
	<meta property="og:description" content={description} />
	<meta property="og:image" content={previewUrl} />
	<meta property="og:url" content={canonicalUrl} />

	<!-- Twitter Cards -->
	<meta name="twitter:card" content="summary_large_image" />
	<meta name="twitter:title" content={title} />
	<meta name="twitter:description" content={description} />
	<meta name="twitter:image" content={previewUrl} />

	<JsonLd schema={schema} />
</head>