-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gatsby-ssr.jsx
44 lines (37 loc) · 910 Bytes
/
gatsby-ssr.jsx
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 RootElement from './src/components/root-element';
const HtmlAttributes = {
lang: 'nl',
};
const HeadComponents = [
<link
key="mnfxRss"
rel="alternate"
type="application/rss+xml"
title="Menefex WMB: RSS Feeds"
href="https://menefex.nl/rss.xml"
/>,
<script key="mnfxDefer" defer={false} />,
];
const BodyAttributes = {
// 'data-theme': 'dark',
};
export const onRenderBody = ({
setHeadComponents,
setHtmlAttributes,
setBodyAttributes,
}) => {
setHtmlAttributes(HtmlAttributes);
setHeadComponents(HeadComponents);
setBodyAttributes(BodyAttributes);
};
export const onPreRenderHTML = ({
getHeadComponents,
replaceHeadComponents,
}) => {
const headComponents = getHeadComponents();
replaceHeadComponents(headComponents);
};
export const wrapRootElement = ({ element }) => {
return <RootElement>{element}</RootElement>;
};