Repository navigation
Expand file tree
/
Copy pathBaseLayout.astro
More file actions
93 lines (91 loc) · 2.9 KB
/
Copy pathBaseLayout.astro
File metadata and controls
93 lines (91 loc) · 2.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
import AmbientBackground from "../components/AmbientBackground.astro";
import Nav from "../components/Nav.astro";
import "../styles/global.css";
interface Props {
title: string;
description: string;
}
const { title, description } = Astro.props;
const canonical = new URL(Astro.url.pathname, Astro.site);
const socialImage = new URL("/social-preview.png", Astro.site);
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content={description} />
<meta name="color-scheme" content="dark light" />
<meta id="theme-color" name="theme-color" content="#080a0d" />
<script is:inline>
(() => {
let savedTheme;
try {
savedTheme = localStorage.getItem("theme");
} catch {}
const theme =
savedTheme === "light" || savedTheme === "dark" ? savedTheme : "dark";
document.documentElement.dataset.theme = theme;
})();
</script>
<link rel="canonical" href={canonical} />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link
rel="preload"
href="/fonts/manrope-latin.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link
rel="preload"
href="/fonts/dm-mono-500-latin.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={canonical} />
<meta property="og:site_name" content="Derek DiLeo" />
<meta property="og:image" content={socialImage} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta
property="og:image:alt"
content="Derek DiLeo, Android Software Engineer — UI architecture, Kotlin, and Jetpack Compose"
/>
<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={socialImage} />
<meta
name="twitter:image:alt"
content="Derek DiLeo, Android Software Engineer — UI architecture, Kotlin, and Jetpack Compose"
/>
<title>{title}</title>
</head>
<body>
<AmbientBackground />
<Nav />
<slot />
<script is:inline>
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add("is-visible");
observer.unobserve(entry.target);
}
});
},
{ threshold: 0.12 },
);
document
.querySelectorAll("[data-reveal]")
.forEach((element) => observer.observe(element));
</script>
</body>
</html>