forked from carbon-design-system/carbon-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
82 lines (79 loc) · 2.35 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
import React from 'react';
export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => {
const script = `
if(!window) window = {};
window.idaPageIsSPA = false;
window.digitalData = {
page: {
category: {
primaryCategory: 'DESIGN',
},
pageInfo: {
ibm: {
siteID: 'CARBON_DESIGN_SYSTEM_WWW',
country: 'US',
industry: 'Design',
owner: 'carbon@us.ibm.com',
},
},
},
}`;
setHeadComponents([
<meta key="image" name="image" content={'/ogimage.png'} />,
<meta
key="og:url"
property="og:url"
content="https://www.carbondesignsystem.com"
/>,
<meta key="og:title" property="og:title" content="Carbon Design System" />,
<meta
key="og:description"
property="og:description"
content="Carbon is IBM’s open source design system for products and digital experiences. With the IBM Design Language as its foundation, the system consists of working code, design tools and resources, human interface guidelines, and a vibrant community of contributors."
/>,
<meta key="og:image" property="og:image" content={'/ogimage.png'} />,
<meta
key="og:image:alt"
property="og:image:alt"
content="Carbon Design System logo"
/>,
<meta key="twitter:image" name="twitter:image" content={'/ogimage.png'} />,
<meta
key="twitter:image:alt"
property="twitter:image:alt"
content="Carbon Design System logo"
/>,
<meta property="og:type" key="og:type" content="website" />,
<meta
property="twitter:card"
key="twitter:card"
content="summary_large_image"
/>,
<meta
property="twitter:site"
key="twitter:site"
content="@_carbondesign"
/>,
<meta
key="twitter:creator"
name="twitter:creator"
content="@_carbondesign"
/>,
<script
src="https://cdn.usefathom.com/script.js"
spa="auto" //eslint-disable-line react/no-unknown-property
site="VMSGXQRS" //eslint-disable-line react/no-unknown-property
key="fathom"
defer
/>,
]);
setPostBodyComponents([
<script key="digital-data" dangerouslySetInnerHTML={{ __html: script }} />,
<script
defer
key="core-metrics"
src="https://1.www.s81c.com/common/stats/ibm-common.js"
type="text/javascript"
/>,
]);
};