3
3
*
4
4
* See: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/
5
5
*/
6
+ const siteUrl = `https://blog.micropasts.org`
6
7
7
8
/**
8
9
* @type {import('gatsby').GatsbyConfig }
@@ -137,6 +138,35 @@ module.exports = {
137
138
}
138
139
}
139
140
} ,
141
+ {
142
+ resolve : "gatsby-plugin-sitemap" ,
143
+ options : {
144
+ query : `
145
+ {
146
+ allSitePage {
147
+ nodes {
148
+ path
149
+ }
150
+ }
151
+
152
+ }
153
+ ` ,
154
+ resolveSiteUrl : ( ) => siteUrl ,
155
+ resolvePages : ( {
156
+ allSitePage : { nodes : allPages }
157
+ } ) => {
158
+
159
+ return allPages . map ( page => {
160
+ return { ...page } ;
161
+ } ) ;
162
+ } ,
163
+ serialize : ( { path } ) => {
164
+ return {
165
+ url : path
166
+ } ;
167
+ }
168
+ }
169
+ } ,
140
170
{
141
171
resolve : `gatsby-plugin-google-gtag` ,
142
172
options : {
@@ -148,6 +178,57 @@ module.exports = {
148
178
} ,
149
179
} ,
150
180
} ,
181
+ {
182
+ resolve : `gatsby-plugin-feed` ,
183
+ options : {
184
+ query : `
185
+ {
186
+ site {
187
+ siteMetadata {
188
+ title
189
+ description
190
+ siteUrl
191
+ site_url: siteUrl
192
+ }
193
+ }
194
+ }
195
+ ` ,
196
+ feeds : [
197
+ {
198
+ serialize : ( { query : { site, allMarkdownRemark } } ) => {
199
+ return allMarkdownRemark . nodes . map ( node => {
200
+ return Object . assign ( { } , node . frontmatter , {
201
+ description : node . excerpt ,
202
+ date : node . frontmatter . date ,
203
+ url : site . siteMetadata . siteUrl + node . frontmatter . permalink ,
204
+ guid : site . siteMetadata . siteUrl + node . frontmatter . permalink ,
205
+ custom_elements : [ { "content:encoded" : node . html } ] ,
206
+ } )
207
+ } )
208
+ } ,
209
+ query : `
210
+ {
211
+ allMarkdownRemark(
212
+ sort: { order: DESC, fields: [frontmatter___date] },
213
+ ) {
214
+ nodes {
215
+ excerpt
216
+ html
217
+ frontmatter {
218
+ title
219
+ date
220
+ permalink
221
+ }
222
+ }
223
+ }
224
+ }
225
+ ` ,
226
+ output : "/rss.xml" ,
227
+ title : "MicroPasts Blog RSS Feed"
228
+ } ,
229
+ ] ,
230
+ } ,
231
+ } ,
151
232
{
152
233
resolve : `gatsby-plugin-manifest` ,
153
234
options : {
0 commit comments