forked from mebtte/animal-photosynthesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
executable file
·101 lines (101 loc) · 2.67 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
module.exports = {
siteMetadata: {
title: 'NotJustCode',
siteUrl: 'https://article.mebtte.com',
description: "mebtte's writting.",
},
plugins: [
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'articles',
path: `${__dirname}/articles`,
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 800,
wrapperStyle: 'margin: 20px 0;',
},
},
'gatsby-remark-responsive-iframe',
{
resolve: 'gatsby-remark-prismjs',
options: {
inlineCodeMarker: '÷',
},
},
{
resolve: 'gatsby-remark-external-links',
options: {
target: '_blank',
},
},
'gatsby-remark-smartypants',
'gatsby-remark-copy-linked-files',
'gatsby-plugin-sitemap',
'gatsby-remark-autolink-headers', // should be listed last
],
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-plugin-react-helmet',
'gatsby-plugin-styled-components',
{
resolve: 'gatsby-plugin-feed',
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { allMarkdownRemark } }) =>
allMarkdownRemark.edges.map(({ node: { fileAbsolutePath, frontmatter: { create, title } } }) => {
const dirs = fileAbsolutePath.split('/');
const id = dirs[dirs.length - 2];
return {
guid: id,
title,
description: title,
date: create,
url: `https://article.mebtte.com/${id}`,
};
}),
query: `
{
allMarkdownRemark(sort: {order: DESC, fields: frontmatter___create}, filter: {frontmatter: {hidden: {eq: false}}}) {
edges {
node {
frontmatter {
create
title
}
fileAbsolutePath
}
}
}
}
`,
output: '/rss.xml',
title: "NotJustCode's RSS Feed",
},
],
},
},
],
};