-
Notifications
You must be signed in to change notification settings - Fork 0
/
Meta.astro
82 lines (71 loc) · 2.48 KB
/
Meta.astro
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
---
import { siteConfig } from "@site-config";
import "@csstools/normalize.css";
import Fonts from "./Fonts.astro";
const { title, description, ogImage, articleDate } = Astro.props;
const titleSeparator = "•";
const pageTitle = `${title} ${titleSeparator} ${siteConfig.title}`;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const socialImageURL = new URL(
ogImage ? ogImage : "/social-card.png",
Astro.url,
).href;
---
<!-- Global Metadata -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="canonical" href={canonicalURL} />
<!-- Icons / Favicon -->
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/icon.svg" />
<!-- Fonts -->
<!-- fonts are inlined so that there are discovered early -->
<Fonts />
<!-- Style sheet -->
<meta name="theme-color" content={siteConfig.themeColor} />
<link rel="stylesheet" type="text/css" href="/style.css" />
<link rel="stylesheet" type="text/css" href="/print.css" media="print" />
<!-- Primary Meta Tags -->
<title>{pageTitle}</title>
<meta name="title" content={pageTitle} />
<meta name="description" content={description} />
<meta name="author" content={siteConfig.author} />
<!-- Licence -->
<link
rel="license"
href="https://github.com/TheBigRoomXXL/lovergne.dev/blob/main/LICENCE.md"
/>
<!-- RSS auto-discovery -->
<link
rel="alternate"
type="application/rss+xml"
title={siteConfig.title}
href="/rss.xml"
/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content={articleDate ? "article" : "website"} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonicalURL} />
<meta property="og:site_name" content={siteConfig.title} />
<meta property="og:locale" content={siteConfig.ogLocale} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image" content={socialImageURL} />
{
articleDate && (
<>
<meta property="article:author" content={siteConfig.author} />
<meta property="article:published_time" content={articleDate} />
</>
)
}
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={canonicalURL} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />