-
Notifications
You must be signed in to change notification settings - Fork 40
/
gatsby-config.js
218 lines (217 loc) · 5.88 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Gatsby has dotenv by default
// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();
module.exports = {
flags: { DEV_SSR: process.env.GATSBY_DEV_SSR || false },
siteMetadata: {
siteTitle: 'Novu - The open-source notification infrastructure',
siteDescription:
'The ultimate library for managing multi-channel transactional notifications with a single API.',
siteImage: '/images/social-preview.jpg',
siteLanguage: 'en',
siteUrl: process.env.GATSBY_DEFAULT_SITE_URL || 'http://localhost:8000',
authorName: 'Pixel Point',
},
trailingSlash: 'always',
plugins: [
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images`,
},
},
'gatsby-plugin-image',
'gatsby-transformer-sharp',
{
resolve: 'gatsby-plugin-sharp',
options: {
defaults: {
quality: 85,
placeholder: 'none',
},
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: process.env.GATSBY_DEFAULT_SITE_URL,
// specify the correct path to your sitemap
sitemap: `${process.env.GATSBY_DEFAULT_SITE_URL}/sitemap-index.xml`,
policy: [{ userAgent: '*', allow: '/' }],
},
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
display: 'minimal-ui',
icon: 'src/images/favicon.png',
},
},
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allWpPost } }) =>
allWpPost.edges.map((edge) => ({
title: edge.node.title,
description: edge.node.pageBlogPost.description,
url: site.siteMetadata.siteUrl + edge.node.uri,
guid: site.siteMetadata.siteUrl + edge.node.uri,
relDir: edge.relativeDirectory,
custom_elements: [{ 'content:encoded': edge.node.content }],
})),
query: `
{
allWpPost(sort: {date: DESC}) {
edges {
node {
content
title
uri
pageBlogPost {
description
}
}
}
}
}
`,
output: '/blog/rss.xml',
title: 'Novu Blog',
},
],
},
},
{
resolve: 'gatsby-plugin-svgr-svgo',
options: {
inlineSvgOptions: [
{
test: /\.inline.svg$/,
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
'prefixIds',
'removeDimensions',
],
},
},
],
},
},
{
resolve: 'gatsby-source-wordpress',
options: {
url: process.env.WP_GRAPHQL_URL,
auth: {
htaccess: {
username: process.env.WP_HTACCESS_USERNAME,
password: process.env.WP_HTACCESS_PASSWORD,
},
},
html: {
fallbackImageMaxWidth: 800, // max-width of the content area
imageQuality: 85,
},
develop: {
nodeUpdateInterval: process.env.WP_NODE_UPDATE_INTERVAL || 5000,
hardCacheMediaFiles: process.env.WP_HARD_CACHE_MEDIA === 'true',
hardCacheData: process.env.WP_HARD_CACHE_DATA === 'true',
},
schema: {
timeout: 60000,
},
},
},
{
resolve: 'gatsby-source-sanity',
options: {
projectId: process.env.GATSBY_SANITY_PROJECT_ID,
dataset: process.env.GATSBY_SANITY_DATASET,
},
},
{
resolve: 'gatsby-plugin-netlify',
options: {
headers: {
'/fonts/*': ['Cache-Control: public, max-age=31536000, immutable'],
'/lottie-assets/*': ['Cache-Control: public, max-age=31536000, immutable'],
'/animations/*': ['Cache-Control: public, max-age=31536000, immutable'],
},
},
},
'gatsby-alias-imports',
'gatsby-plugin-postcss',
'gatsby-plugin-sitemap',
{
resolve: `gatsby-plugin-segment-js`,
options: {
prodKey: process.env.GATSBY_SEGMENT_WRITE_KEY,
},
},
// TODO: to uncomment the creation of podcast pages after this link works - https://feeds.transistor.fm/sourcelife
// {
// resolve: `gatsby-source-rss-feed`,
// options: {
// url: `https://feeds.transistor.fm/sourcelife`,
// name: `Podcast`,
// },
// },
{
resolve: `gatsby-source-github-api`,
options: {
token: process.env.GITHUB_TOKEN,
graphQLQuery: `
query {
repository(owner: "novuhq", name: "novu") {
issues(first: 100, filterBy: {labels: ["polishing"]}) {
nodes {
title
number
url
state
assignees(first: 1) {
nodes {
name
login
avatarUrl
url
}
}
author {
url
avatarUrl
login
}
}
}
}
}`,
},
},
],
};