-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseLayout.astro
More file actions
138 lines (128 loc) · 4.83 KB
/
Copy pathBaseLayout.astro
File metadata and controls
138 lines (128 loc) · 4.83 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
import Navbar from '@/components/Navbar.astro';
import Footer from '@/components/Footer.astro';
import '@/styles/global.css';
interface Props {
title: string;
description: string;
/** Absolute path to the generated OG image for this route. */
ogImage?: string;
ogType?: 'website' | 'article';
/** Emit the schema.org Person block (home page only). */
personSchema?: boolean;
}
const {
title,
description,
ogImage = '/og/index.png',
ogType = 'website',
personSchema = false,
} = Astro.props;
// Keep the trailing slash: Cloudflare Pages 308-redirects /blog/adr47 to
// /blog/adr47/, and the sitemap emits the slashed form. Stripping it here would
// point the canonical at a URL that redirects to the canonical.
const canonical = new URL(Astro.url.pathname, Astro.site).href;
const ogImageUrl = new URL(ogImage, Astro.site).href;
// The previous markup deferred the webfont with media="print"
// onload="this.media='all'", but _headers sets script-src without
// 'unsafe-inline', so the CSP blocked the inline handler and the swap never
// fired. Loaded directly instead; preconnect plus display=swap keeps it cheap.
const fontHref =
'https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&family=IBM+Plex+Mono:wght@400;500&display=swap';
---
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="theme-color" content="#FCFCFA" />
<link rel="sitemap" href="/sitemap-index.xml" />
{/* Open Graph */}
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:type" content={ogType} />
<meta property="og:url" content={canonical} />
<meta property="og:image" content={ogImageUrl} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:site_name" content="Diego Said" />
<meta property="og:locale" content="en_US" />
{/* 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={ogImageUrl} />
{/* Fonts: see the note in the frontmatter above. */}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href={fontHref} />
{
personSchema && (
<script
is:inline
type="application/ld+json"
set:html={JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Person',
name: 'Diego Said Anaya Mancilla',
alternateName: 'Diego Said',
jobTitle: 'Software Engineer Technical Lead',
url: 'https://diegosaid.com',
sameAs: [
'https://github.com/redcpp',
'https://www.linkedin.com/in/redcpp',
'https://pubmed.ncbi.nlm.nih.gov/?term=Anaya-Mancilla+DS',
],
worksFor: {
'@type': 'Organization',
name: 'Century 21 CAM Grupo',
url: 'https://www.camgrupo.com',
},
alumniOf: [
{
'@type': 'EducationalOrganization',
name: 'University of Colorado Boulder',
url: 'https://www.colorado.edu',
},
{
'@type': 'EducationalOrganization',
name: 'Harvard Business School Online',
url: 'https://online.hbs.edu',
},
{
'@type': 'EducationalOrganization',
name: 'Universidad Autónoma de Querétaro',
url: 'https://www.uaq.mx',
},
],
knowsAbout: [
'Software Engineering',
'REST API Design',
'Data Pipelines',
'Cloud Infrastructure',
'LLM Integration',
'DeFi Protocol Design',
],
})}
/>
)
}
{/* Plausible Analytics */}
<script is:inline defer data-domain="diegosaid.com" src="https://plausible.io/js/script.js"
></script>
</head>
<body>
<div class="min-h-screen flex flex-col bg-paper">
<Navbar />
<main class="flex-1 pt-14">
<slot />
</main>
<Footer />
</div>
</body>
</html>