-
Notifications
You must be signed in to change notification settings - Fork 17
/
gatsby-ssr.tsx
53 lines (52 loc) · 1.3 KB
/
gatsby-ssr.tsx
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
import React from "react"
// Adds a class name to the body element
export const onRenderBody = ({ setBodyAttributes, setHeadComponents }) => {
setHeadComponents([
<link
rel="preload"
href="/fonts/cmunrm.ttf"
as="font"
type="font/ttf"
crossOrigin="anonymous"
key="computerModernFont"
/>,
<link
rel="preload"
href="/fonts/cmunti.ttf"
as="font"
type="font/ttf"
crossOrigin="anonymous"
key="computerModernItalicFont"
/>,
<link
rel="preconnect"
href="https://fonts.googleapis.com"
key={"googleFontsPreconnect"}
/>,
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="anonymous"
key={"gstaticPreconnect"}
/>,
<link
href="https://fonts.googleapis.com/css2?family=Unbounded:wght@700&display=swap"
rel="stylesheet"
media="screen"
key={"unboundedFont"}
/>,
<link
href="https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@700&display=swap"
rel="stylesheet"
key={"minchoFont"}
/>,
<link
href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@700&display=swap"
rel="stylesheet"
key={"notoSerifFont"}
/>,
])
setBodyAttributes({
className: "custom latex-dark",
})
}