-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.ts
220 lines (204 loc) · 5.39 KB
/
gatsby-config.ts
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
219
220
import type { GatsbyConfig } from 'gatsby';
require('dotenv').config({
// path: `.env.${process.env.NODE_ENV}`,
path: `.env`,
});
const siteMetadata = {
title: `Eternity Percussion`,
slogan: `The Leaders of Tomorrow`,
description: `Eternity is een culturele instelling die zich bezighoudt met activiteiten, projecten en evenementen op het gebied van muzikale vorming en performance.`,
siteUrl: `https://eternitydrum.com`,
image: `/ep-logo.png`,
twitterUsername: `@eternitydrum`,
facebookUrl: `https://www.facebook.com/EternityDrum/`,
instagramUrl: `https://www.instagram.com/percussionband_eternity/`,
linkedinUrl: `#!`,
youtubeUrl: `https://www.youtube.com/@eternitydrum`,
telephoneBpt: `+31 (0)20 311 39 33`,
telephoneSeda: `+31 (0)20 773 38 88`,
mobile: `+31 (0)6 242 55 391`,
phoneRawBpt: `31203113933`,
phoneRawSeda: `31207733888`,
mobileRaw: `31624255391`,
email: `[email protected]`,
address: `Anton de Komplein 240`,
postalCode: `1102 DR`,
city: `Amsterdam-Zuidoost`,
companyName: `Stichting Eternity Percussion`,
kvk: `34284743`,
btw: `NL818556286B01`,
bank: `NL53 ABNA 0591 433 923`,
bgWebColor: `#181a37`,
bgThemeColor: `#f6ce0e`,
}
const { siteUrl, title, bgWebColor, bgThemeColor } = siteMetadata;
const config: GatsbyConfig = {
siteMetadata: siteMetadata,
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
// If you use VSCode you can also use the GraphQL plugin
// Learn more at: https://gatsby.dev/graphql-typegen
graphqlTypegen: true,
plugins: [
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: 'GTM-MR6HHSRT',
includeInDevelopment: false,
defaultDataLayer: { platform: 'gatsby' },
// Specify optional GTM environment details.
// gtmAuth: "YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_AUTH_STRING",
// gtmPreview: "YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_PREVIEW_NAME",
},
},
{
resolve: 'gatsby-source-contentful',
options: {
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
spaceId: process.env.CONTENTFUL_SPACE_ID,
host: process.env.CONTENTFUL_HOST,
},
},
'gatsby-plugin-preload-fonts',
'gatsby-plugin-mdx',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images/`,
},
__key: 'images',
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'pages',
path: `${__dirname}/src/pages/`,
},
__key: 'pages',
},
{
resolve: 'gatsby-plugin-nprogress',
options: {
color: bgThemeColor,
showSpinner: true,
minimum: 0.1,
},
},
'gatsby-plugin-image',
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: `gatsby-plugin-sass`,
options: {
implementation: require('sass'),
sassOptions: {
silenceDeprecations: ['legacy-js-api'],
},
},
},
'gatsby-plugin-catch-links',
{
resolve: 'gatsby-plugin-canonical-urls',
options: {
siteUrl: siteUrl,
},
},
{
resolve: 'gatsby-plugin-sitemap',
options: {
query: `
{
allSitePage {
nodes {
path
}
}
allContentfulPost {
nodes {
slug
updatedAt
}
}
allContentfulVacancy {
nodes {
slug
updatedAt
}
}
}
`,
resolveSiteUrl: () => siteUrl,
resolvePages: ({
allSitePage,
allContentfulPost,
allContentfulVacancy,
}: {
allSitePage: { nodes: { path: string }[] };
allContentfulPost: { nodes: { slug: string; updatedAt: string }[] };
allContentfulVacancy: { nodes: { slug: string; updatedAt: string }[] };
}) => {
const postsMap = allContentfulPost.nodes.reduce((acc: Record<string, any>, post) => {
const { slug, updatedAt } = post;
acc[`/${slug}/`] = { path: `/${slug}/`, updatedAt };
return acc;
}, {});
const vacanciesMap = allContentfulVacancy.nodes.reduce((acc: Record<string, any>, vacancy) => {
const { slug, updatedAt } = vacancy;
acc[`/over-ons/vacatures/${slug}/`] = { path: `/over-ons/vacatures/${slug}/`, updatedAt };
return acc;
}, {});
const combinedPages = allSitePage.nodes.map((page) => {
return (
postsMap[page.path] ||
vacanciesMap[page.path] ||
{ path: page.path }
);
});
return [
...Object.values(postsMap),
...Object.values(vacanciesMap),
...combinedPages.filter(
(page) =>
!postsMap[page.path] && !vacanciesMap[page.path]
),
];
},
serialize: ({ path, updatedAt }: { path: string; updatedAt?: string }) => {
return {
url: path,
lastmod: updatedAt || new Date().toISOString(),
changefreq: 'daily',
priority: 0.7,
};
},
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
sitemap: siteUrl + '/sitemap-index.xml',
policy: [{ userAgent: '*', allow: '/' }],
},
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'EP Webapp',
short_name: title,
description: 'Ervaar onze Eternity Percussion webapplicatie geintegregreerd op uw toestel',
start_url: '/',
background_color: bgThemeColor,
lang: 'nl',
theme_color: bgWebColor,
display: 'standalone',
icon: 'src/images/logo/ep-logo-yellow.png',
icon_options: {
purpose: 'any maskable',
},
crossOrigin: 'use-credentials',
},
},
'gatsby-plugin-offline',
],
};
export default config;