-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-feed-config.js
50 lines (50 loc) · 1.5 KB
/
gatsby-feed-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
module.exports = {
resolve: `gatsby-plugin-feed`,
options: {
generator: 'GatsbyJS',
query:
' { site { siteMetadata { title description siteUrl site_url: siteUrl } } } ',
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) => {
return allMarkdownRemark.edges.map((edge) => {
return Object.assign({}, edge.node.frontmatter, {
description: edge.node.excerpt,
date: edge.node.frontmatter.date,
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
custom_elements: [{ 'content:encoded': edge.node.html }],
})
})
},
query: `
{
allMarkdownRemark(
limit: 25
filter: {frontmatter: {released: {ne: false}, hidden: {ne: true}}}
sort: {frontmatter: {date: DESC}}
) {
edges {
node {
frontmatter {
title
date
}
fields {
slug
}
excerpt
html
}
}
}
}
`,
// Where we will save the feed generated by this query.
output: 'rss.xml',
// Use a title when reference a RSS feed in Link element.
title: 'usubeni fanstay',
},
],
},
}