This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
gatsby-config.js
201 lines (197 loc) · 6.47 KB
/
gatsby-config.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.com/docs/gatsby-config/
*/
require("dotenv").config()
module.exports = {
siteMetadata: {
title: `LivePerson Knowledge Center`,
siteUrl: "https://knowledge.liveperson.com/",
description: "Manage, measure, and scale messaging conversations",
},
plugins: [
`gatsby-plugin-layout`,
{
resolve: "@kentico/gatsby-source-kontent",
options: {
projectId: process.env.KONTENT_PROJECT_ID,
usePreviewUrl:
process.env.KONTENT_PREVIEW_ENABLED &&
process.env.KONTENT_PREVIEW_ENABLED.toLowerCase() === "true",
authorizationKey:
process.env.KONTENT_PREVIEW_ENABLED &&
process.env.KONTENT_PREVIEW_ENABLED.toLowerCase() === "true"
? process.env.KONTENT_PREVIEW_KEY
: undefined,
languageCodenames: process.env.KONTENT_LANGUAGE_CODENAMES.split(
","
).map(lang => lang.trim()),
includeTaxonomies: true,
experimental: {
managementApiTriggersUpdate: true, // opt-out by default
},
},
},
{
resolve: `gatsby-plugin-sass`,
options: {
postCssPlugins: [
require("tailwindcss"),
require("./tailwind.config.js"), // Optional: Load custom Tailwind CSS configuration
],
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// The property ID; the tracking code won't be generated without it
trackingId: "UA-277946-55",
// Defines where to place the tracking script - `true` in the head and `false` in the body
head: false,
//change this when you want it to work
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
},
},
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [
`Inter\:100,200,300,400,500,600,700,800,900`,
`Space Grotesk\:100,200,300,400,500,600,700,800,900`,
],
display: "swap",
},
},
{
resolve: `gatsby-plugin-hotjar-tracking`,
options: {
includeInDevelopment: false,
id: process.env.HOTJAR_ID,
sv: 6,
},
},
{
resolve: `gatsby-plugin-gdpr-cookies`,
options: {
googleAnalytics: {
trackingId: "UA-277946-55",
// Setting this parameter is optional
anonymize: true,
},
// Defines the environments where the tracking should be available - default is ["production"]
environments: ["production", "development"],
},
},
{
resolve: `gatsby-plugin-algolia`,
options: {
appId: process.env.GATSBY_ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_ADMIN_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
queries: require("./src/utils/algolia-queries"),
},
},
`gatsby-plugin-styled-components`,
`gatsby-plugin-postcss`,
`gatsby-plugin-dark-mode`,
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
{
resolve: `gatsby-plugin-feed`,
options: {
feeds: [
{
serialize: ({
query: {
site,
allKontentItemPostWhatsnew,
allKontentItemReleaseNotesPage,
},
}) => {
const stripKentico = content =>
content.replace(/( |<([^>]+)>)/gi, "")
let releaseNotes = allKontentItemReleaseNotesPage.nodes.map(
node => ({
title: `${node.elements.pagename.value} - Release Notes`,
description: stripKentico(node.elements.subtitle.value),
date: node.elements.date.value,
url: `${site.siteMetadata.siteUrl}/release-notes/${node.elements.permalink.value}`,
guid: node.elements.permalink.value,
})
)
let whatsNew = allKontentItemPostWhatsnew.nodes.map(node => ({
title: `${node.elements.pagename.value} - What's New`,
description: stripKentico(node.elements.subtitle.value),
date: node.elements.date.value,
url: `${site.siteMetadata.siteUrl}/whats-new/${node.elements.permalink.value}`,
guid: node.elements.permalink.value,
}))
return releaseNotes
.concat(whatsNew)
.sort((a, b) =>
a.date < b.date ? -1 : a.date > b.date ? 1 : 0
)
},
query: `{
site {
siteMetadata {
siteUrl
description
}
}
allKontentItemReleaseNotesPage(sort: {order: DESC, fields: elements___date___value}) {
nodes {
elements {
date {
value
}
pagename {
value
}
subtitle {
value
}
permalink {
value
}
}
}
}
allKontentItemPostWhatsnew(sort: {order: DESC, fields: elements___date___value}) {
nodes {
elements {
date {
value
}
pagename {
value
}
subtitle {
value
}
permalink {
value
}
}
}
}
}`,
output: "/rss.xml",
title: "LivePerson Knowledge Center - Feed",
},
],
},
},
{
resolve: `gatsby-plugin-gatsby-cloud`,
options: {
mergeSecurityHeaders: false, // boolean to turn off the default security headers should be fixed
mergeCachingHeaders: true,
},
},
],
}