-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgatsby-ssr.tsx
66 lines (63 loc) · 1.94 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
54
55
56
57
58
59
60
61
62
63
64
65
66
/************************
* Made by [MR Ferry™] *
* on May 2020 *
************************/
import * as React from "react";
export function onPreRenderHTML({ getHeadComponents, replaceHeadComponents }: any) {
const headComponents = getHeadComponents();
const styleHeadComponents = headComponents.filter((component: { type: string }) => component.type === "style");
const nonStyleHeadComponents = headComponents.filter((component: { type: string }) => component.type !== "style");
replaceHeadComponents([nonStyleHeadComponents, styleHeadComponents]);
}
export const onRenderBody = ({ setHeadComponents }: any) => {
setHeadComponents([
// <link
// key="work-sans-italic-vietnam"
// rel="preload"
// href="/fonts/QGYqz_wNahGAdqQ43Rh_eZDkv_1w4A.woff2"
// as="font"
// type="font/woff2"
// crossOrigin="anonymous"
// />,
// <link
// key="work-sans-italic-latin-ext"
// rel="preload"
// href="/fonts/QGYqz_wNahGAdqQ43Rh_eZDlv_1w4A.woff2"
// as="font"
// type="font/woff2"
// crossOrigin="anonymous"
// />,
// <link
// key="work-sans-italic-latin"
// rel="preload"
// href="/fonts/QGYqz_wNahGAdqQ43Rh_eZDrv_0.woff2"
// as="font"
// type="font/woff2"
// crossOrigin="anonymous"
// />,
// <link
// key="work-sans-normal-vietnam"
// rel="preload"
// href="/fonts/QGYsz_wNahGAdqQ43Rh_c6Dpp_k.woff2"
// as="font"
// type="font/woff2"
// crossOrigin="anonymous"
// />,
// <link
// key="work-sans-normal-latin-ext"
// rel="preload"
// href="/fonts/QGYsz_wNahGAdqQ43Rh_cqDpp_k.woff2"
// as="font"
// type="font/woff2"
// crossOrigin="anonymous"
// />,
<link
key="work-sans-normal-latin"
rel="preload"
href="/fonts/QGYsz_wNahGAdqQ43Rh_fKDp.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>,
]);
};