-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
84 lines (84 loc) · 2.44 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
module.exports = {
siteMetadata: {
title: "adrift on a cosmic ocean",
siteUrl: "https://paperairoplane.net",
description:
"Writings on various topics (mostly technical) from Oliver Hookins and Angela Collins"
},
plugins: [
"gatsby-plugin-image",
"gatsby-plugin-react-helmet",
"gatsby-transformer-remark",
{
resolve: "gatsby-source-contentful",
options: {
spaceId: process.env.SPACE_ID,
accessToken: process.env.ACCESS_TOKEN
}
},
{
resolve: "gatsby-plugin-feed",
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
title: "paperairoplane.net RSS feed",
serialize: ({ query: { site, allContentfulPost } }) => {
return allContentfulPost.edges.map(edge => {
return Object.assign({}, edge.node, {
title: edge.node.title,
description: edge.node.body.childMarkdownRemark.excerpt,
author:
edge.node.author.firstName +
" " +
edge.node.author.lastName,
date: edge.node.published,
url: site.siteMetadata.siteUrl + "/posts/" + edge.node.slug,
guid: site.siteMetadata.siteUrl + "/posts/" + edge.node.slug
});
});
},
query: `
{
allContentfulPost (limit: 1000) {
edges {
node {
id
slug
title
published
category {
realname
}
author {
firstName
lastName
}
body {
childMarkdownRemark {
excerpt(pruneLength: 400)
}
}
}
}
}
}
`,
output: "/rss.xml"
}
]
}
}
]
};