Repository navigation
Expand file tree
/
Copy pathBase.astro
More file actions
67 lines (64 loc) · 2.01 KB
/
Copy pathBase.astro
File metadata and controls
67 lines (64 loc) · 2.01 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
---
import "@fontsource-variable/archivo/wdth.css";
import "@fontsource-variable/public-sans";
import "@fontsource-variable/martian-mono";
import "../styles/patchyard.css";
import SiteFooter from "../components/SiteFooter.astro";
import SiteHeader from "../components/SiteHeader.astro";
interface Props {
title: string;
description: string;
favicon?: string;
themeColor?: string;
/** A 1280×640 social preview image, as a path on this site. */
image?: string;
/** On a tool's page: the tool, for the header. */
product?: { name: string; href: string };
}
const {
title,
description,
favicon = "/favicon.svg",
themeColor = "#142a4f",
image,
product,
} = Astro.props;
const canonical = new URL(Astro.url.pathname, Astro.site);
const imageUrl = image ? new URL(image, Astro.site) : null;
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<meta name="theme-color" content={themeColor} />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
<link rel="icon" type="image/svg+xml" href={favicon} />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Patchyard" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonical} />
{imageUrl && (
<>
<meta property="og:image" content={imageUrl} />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="640" />
</>
)}
<meta name="twitter:card" content={imageUrl ? "summary_large_image" : "summary"} />
</head>
<body>
<a class="p-skip" href="#main">
Skip to content
</a>
<SiteHeader product={product} />
<main id="main" tabindex="-1">
<slot />
</main>
<SiteFooter />
</body>
</html>