-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
88 lines (85 loc) · 2.42 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
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
83
84
85
86
87
88
import React from 'react';
import PageElement from './src/components/page/page-element';
import RootElement from './src/components/page/root-element';
export const wrapPageElement = ({ element, props }) => {
return <PageElement {...props}>{element}</PageElement>;
};
export const wrapRootElement = ({ element }) => {
return <RootElement>{element}</RootElement>;
};
export const onRenderBody = ({ setHtmlAttributes, setHeadComponents }) => {
setHtmlAttributes({ lang: 'en-GB' });
setHeadComponents([
<link key="x-icon" rel="icon" type="image/x-icon" href="/images/favicon.ico" />,
<link key="webmtion" rel="webmention" href="https://webmention.io/worldwildweb.dev/webmention" />,
<link key="pingback" rel="pingback" href="https://webmention.io/worldwildweb.dev/xmlrpc" />,
<link
key="16x16"
rel="icon"
type="image/png"
sizes="16x16"
href="/images/favicon-16x16.png"
data-react-helmet="true"
/>,
<link
key="32x32"
rel="icon"
type="image/png"
sizes="32x32"
href="/images/favicon-32x32.png"
data-react-helmet="true"
/>,
<link
key="inconsolata-regular"
rel="preload"
href="/fonts/Inconsolata-Regular.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>,
<link
key="inconsolata-medium"
rel="preload"
href="/fonts/Inconsolata-Medium.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>,
<link
key="inconsolata-black"
rel="preload"
href="/fonts/Inconsolata-Black.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>,
<style
key="inline-style"
dangerouslySetInnerHTML={{
__html: `
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(/fonts/Inconsolata-Regular.woff2) format('woff2');
}
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(/fonts/Inconsolata-Medium.woff2) format('woff2');
}
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url(/fonts/Inconsolata-Black.woff2) format('woff2');
}
`
}}
/>
]);
};