-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgatsby-config.js
114 lines (109 loc) · 3.17 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
const rssPostQuery = `
{
allMarkdownRemark(
sort: { order: DESC, fields: [fileAbsolutePath] },
filter: { fields: { slug: { regex: "/blog/" } } }
) {
edges {
node {
html
fields { slug }
frontmatter {
title
spoiler
date(formatString: "MMMM DD, YYYY")
draft
}
}
}
}
}
`;
const createRssPost = (edge, site) => {
const url = site.siteMetadata.siteUrl + edge.node.fields.slug;
return {
...edge.node.frontmatter,
description: edge.node.frontmatter.spoiler,
date: edge.node.frontmatter.date,
url,
guid: url,
custom_elements: [{ 'content:encoded': edge.node.html }],
};
};
const SITE_TITLE = 'fedknu.com';
const SITE_DESCRIPTION =
'Personal blog about frontend web development, with a focus on accessibility, web components and functional reactive programming.';
module.exports = {
siteMetadata: {
title: SITE_TITLE,
author: SITE_TITLE,
description: SITE_DESCRIPTION,
siteUrl: 'https://fedknu.com',
social: {
twitter: '@fedknu',
},
},
pathPrefix: '/',
plugins: [
{
resolve: 'gatsby-plugin-manifest',
options: {
name: SITE_TITLE,
short_name: 'F. Knüssel',
start_url: '/',
background_color: '#1b1b1b',
theme_color: '#f3c868',
display: 'minimal-ui',
icon: 'static/favicon.png',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 590,
showCaptions: true,
},
},
{
resolve: 'gatsby-remark-vscode',
},
{
resolve: 'gatsby-remark-embedder',
},
],
},
},
{
resolve: 'gatsby-plugin-feed',
options: {
feeds: [
{
// Make sure to filter out drafts from the feed
serialize: ({ query: { site, allMarkdownRemark } }) =>
allMarkdownRemark.edges.filter((e) => !e.node.frontmatter.draft).map((e) => createRssPost(e, site)),
query: rssPostQuery,
output: '/rss.xml',
title: SITE_TITLE,
description: SITE_DESCRIPTION,
},
],
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-plugin-react-helmet',
'gatsby-plugin-vanilla-extract',
'gatsby-plugin-graphql-codegen',
],
};