-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gatsby-config.js
224 lines (224 loc) · 6.96 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
219
220
221
222
223
224
module.exports = {
siteMetadata: {
title: 'Hello Gatsby Starter',
author: {
name: 'Hello Tham',
url: 'https://hellotham.com',
summary:
'Hello Tham is a boutique management consulting firm. We specialise in Business and IT strategies, operating models, strategic roadmaps, enterprise architecture, analytics and business process design.',
},
description: 'A Gatsby v4 starter for corporate/marketing/blog websites.',
siteUrl: 'https://hello-gatsby-starter.hellotham.com',
location: 'Rivendell, Middle Earth',
social: {
email: 'mailto:[email protected]',
phone: 'tel:+61234567890',
facebook: 'https://www.facebook.com',
instagram: 'https://www.instagram.com',
twitter: 'https://twitter.com',
linkedin: 'https://www.linkedin.com',
github: 'https://github.com',
},
},
plugins: [
{
resolve: 'gatsby-plugin-react-leaflet',
options: {
linkStyles: true, // (default: true) Enable/disable loading stylesheets via CDN
},
},
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: /\.inline\.svg$/,
},
},
},
'gatsby-plugin-postcss',
'gatsby-plugin-react-helmet',
'gatsby-plugin-image',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'mdx',
path: `${__dirname}/src/mdx/`,
},
},
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 2048,
linkImagesToOriginal: false,
},
},
{ resolve: 'gatsby-remark-copy-linked-files' },
{ resolve: 'gatsby-remark-smartypants' },
],
remarkPlugins: [{ resolve: 'remark-slug' }, { resolve: '@mapbox/rehype-prism' }],
},
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'Hello Gatsby Starter',
short_name: 'hello-gatsby-starter',
start_url: '/',
background_color: '#ffffff',
theme_color: '#660099',
display: 'minimal-ui',
icon: 'src/images/gatsby/Gatsby_Monogram.png', // This path is relative to the root of the site.
},
},
'gatsby-plugin-robots-txt',
{
resolve: 'gatsby-plugin-sitemap',
options: {
output: '/sitemap',
query: `
{
site {
siteMetadata {
siteUrl
}
}
allSitePage(filter: { path: {regex: "/^(?!/404/|/404.html|/dev-404-page/)/"} }) {
nodes {
path
}
}
}
`,
resolvePages: ({ allSitePage: { nodes: allPages } }) => {
return allPages.map(page => {
return { ...page }
})
},
serialize: ({ path }) => {
return {
url: path,
changefreq: 'weekly',
priority: 0.7,
}
},
},
},
{
resolve: 'gatsby-plugin-feed-mdx',
options: {
query: `
{
site {
siteMetadata {
title
description
author {
name
}
siteUrl
site_url: siteUrl
}
buildTime
}
allFile(filter: {relativePath: {eq: "gatsby/Gatsby_Monogram.png"}}) {
nodes {
childImageSharp {
resize(width: 1200) {
src
}
}
}
}
}
`,
setup(options) {
return Object.assign({}, options.query, {
title: options.query.site.siteMetadata.title,
feed_url: options.query.site.siteMetadata.siteUrl + '/rss.xml',
image_url:
options.query.site.siteMetadata.siteUrl + options.query.allFile.nodes[0].childImageSharp.resize.src,
author: options.query.site.siteMetadata.author.name,
managingEditor: options.query.site.siteMetadata.author.name,
webMaster: options.query.site.siteMetadata.author.name,
copyright: options.query.site.buildTime.slice(0, 4) + ' ' + options.query.site.siteMetadata.title,
language: 'en',
pubDate: options.query.site.buildTime,
})
},
feeds: [
{
serialize: ({ query: { site, allMdx } }) => {
return allMdx.edges.map(edge => {
return Object.assign({}, edge.node.frontmatter, {
description: edge.node.frontmatter.description,
author: edge.node.frontmatter.author,
date: edge.node.frontmatter.date,
url: site.siteMetadata.siteUrl + '/' + edge.node.slug,
guid: site.siteMetadata.siteUrl + '/' + edge.node.slug,
enclosure: {
url: site.siteMetadata.siteUrl + edge.node.frontmatter.image.childImageSharp.resize.src,
},
categories: edge.node.frontmatter.tags,
custom_elements: [{ 'content:encoded': edge.node.html }],
})
})
},
query: `
{
allMdx(
filter: { slug: { regex: "/^post/" } }
sort: { order: DESC, fields: [frontmatter___date] }
) {
edges {
node {
frontmatter {
title
description
author
date
image {
childImageSharp {
resize(width: 1200) {
src
}
}
}
tags
}
html
slug
}
}
}
}
`,
output: '/rss.xml',
// optional configuration to insert feed reference in pages:
// if `string` is used, it will be used to create RegExp and then test if pathname of
// current page satisfied this regular expression;
// if not provided or `undefined`, all pages will have feed reference inserted
// match: '^/post/',
},
],
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// "gatsby-plugin-offline",
'gatsby-plugin-gatsby-cloud',
],
}