-
Notifications
You must be signed in to change notification settings - Fork 3
/
gatsby-ssr.js
81 lines (79 loc) · 2.06 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
import React from 'react';
import PageElement from './src/components/page-element';
export const wrapPageElement = ({ element, props }) => {
return <PageElement {...props}>{element}</PageElement>;
};
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="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');
}
`
}}
/>
]);
};