-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-ssr.js
32 lines (30 loc) · 959 Bytes
/
gatsby-ssr.js
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
const React = require("react");
const QAPI = require("./qapi").default;
const { window, document, extend } = require("ssr-window");
export const onRenderBody = (
{
setHeadComponents,
setPostBodyComponents,
},
pluginOptions
) => {
setHeadComponents([
<style>{`
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
`}</style>,
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source%20Sans%20Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap" />,
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Passion%20One:ital,wght@0,400;0,700;0,900&display=swap" />,
]),
setPostBodyComponents([
<script
key="QAPI"
dangerouslySetInnerHTML={{
__html: `window.QAPI = ${JSON.stringify(QAPI || {})}`
}}
/>,
])
}