This repository was archived by the owner on Jul 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathgatsby-config.ts
More file actions
152 lines (150 loc) · 3.06 KB
/
Copy pathgatsby-config.ts
File metadata and controls
152 lines (150 loc) · 3.06 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import { PostsQuery } from './src/types/GraphQL';
import theme from './src/theme';
const title = 'Artem Sapegin’s Blog';
const siteUrl = 'https://blog.sapegin.me';
export default {
siteMetadata: {
siteUrl,
title,
description:
'Blog of a Berlin based frontend developer who works at Here, makes photos, writes, hangs out with his dogs and drinks coffee.',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-styled-components',
`gatsby-transformer-json`,
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/content`,
name: 'pages',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/data`,
name: 'data',
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-prismjs',
options: {
aliases: {
coffee: 'coffeescript',
},
},
},
{
resolve: `gatsby-remark-twitter-cards`,
options: {
title,
separator: '',
author: '',
background: require.resolve(
'./assets/twitter-card-background.png'
),
fontColor: theme.colors.base,
titleFontSize: 96,
subtitleFontSize: 60,
fontFile: require.resolve('./assets/SabonBold.ttf'),
},
},
'remark-tips',
],
},
},
{
resolve: 'gatsby-plugin-feed',
options: {
feeds: [
{
serialize: ({
query: { allMarkdownRemark },
}: {
query: PostsQuery;
}) => {
return allMarkdownRemark.edges.map((edge) => {
const url = `${siteUrl}/${edge.node.fields.slug}`;
return {
...edge.node.frontmatter,
description: edge.node.excerpt,
date: edge.node.frontmatter.date,
url,
guid: url,
custom_elements: [
{
'content:encoded': edge.node.html,
},
],
};
});
},
query: `
{
allMarkdownRemark(
filter: { fileAbsolutePath: { regex: "/all/.*/" } }
sort: { fields: [frontmatter___date], order: DESC },
limit: 20,
) {
edges {
node {
frontmatter {
title
date
}
fields {
slug
}
excerpt
html
}
}
}
}
`,
output: '/atom.xml',
title,
},
],
},
},
'gatsby-plugin-sitemap',
{
resolve: 'gatsby-plugin-netlify',
options: {
headers: {
// Cache fonts forever
'/fonts/*': [
'Cache-Control: public',
'Cache-Control: max-age=365000000',
'Cache-Control: immutable',
],
// Cache images for a week
'/images/*': [
'Cache-Control: public',
'Cache-Control: max-age=604800',
],
},
},
},
'gatsby-plugin-typescript',
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl,
},
},
{
resolve: 'gatsby-plugin-goatcounter',
options: {
code: 'sapegin-blog',
allowLocal: false,
},
},
],
};