-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
44 lines (43 loc) · 1.21 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
import React from "react"
import { Partytown } from "@builder.io/partytown/react"
const HeadComponents = [
<Partytown key="partytown" debug={true} forward={["dataLayer.push"]} />,
<link
rel="preload"
href="https://www.bobmatyas.com/fonts/GentiumBookBasic-BoldItalic.woff"
as="font"
type="font/woff2"
crossOrigin="anonymous"
key="gentiumFont"
/>,
<link
rel="preload"
href="https://www.bobmatyas.com/fonts/PermanentMarker-Regular.woff"
as="font"
type="font/woff2"
crossOrigin="anonymous"
key="permanentFont"
/>,
]
export function onRenderBody({
setHeadComponents,
setHtmlAttributes,
setPostBodyComponents,
}) {
setHtmlAttributes({ lang: "en" })
setHeadComponents(HeadComponents),
setPostBodyComponents([
React.createElement(`div`, {
key: `cloudflare-analytics`,
dangerouslySetInnerHTML: {
__html: `
<!-- Cloudflare Web Analytics -->
<script type="text/partytown" src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "9c46957e3f89451a8c879dc672753cfa"}'>
</script>
<!-- End Cloudflare Web Analytics -->
`,
},
}),
])
}