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
|
---
export interface Props {
title: string;
description: string;
image?: string;
type?: string;
next?: string;
prev?: string;
canonicalURL?: string | URL;
}
const { title, description, image, type, next, prev, canonicalURL } = Astro.props as Props;
---
<!-- Common -->
<meta charset="UTF-8">
<title>{title}</title>
<meta name="description" content={description}>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href={Astro.resolve('../styles/global.css')} />
<!-- Sitemap -->
<link rel="sitemap" href="/sitemap.xml">
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" href="/feed/posts.xml">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<!-- SEO -->
<link rel="canonical" href={canonicalURL}>
{next && <link rel="next" aria-label="Previous Page" href={new URL(next, canonicalURL).href}>}
{prev && <link rel="prev" aria-label="Next Page" href={new URL(prev, canonicalURL).href}>}
<!-- OpenGraph -->
<meta property="og:title" content={title}>
<meta property="og:description" content={description}>
{image && (<meta property="og:image" content={new URL(image, canonicalURL)}>)}
<!-- Twitter -->
<meta name="twitter:card" content={image ? 'summary_large_image' : 'summary'}>
<meta name="twitter:site" content="@astro">
<meta name="twitter:title" content={title}>
<meta name="twitter:description" content={description}>
{image && (<meta name="twitter:image" content={image}>)}
|