-
Notifications
You must be signed in to change notification settings - Fork 4
/
gatsby-config.js
executable file
·191 lines (190 loc) · 5.37 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
const path = require('path')
const here = (...p) => path.join(__dirname, ...p)
const _ = require('lodash')
module.exports = {
siteMetadata: {
title: `Illustrated.dev`,
description: `Illustrated web development & javascript tutorials`,
author: '@mappletons',
twitterUsername: '@mappletons',
image: '/static/images/id_opengraph.png',
},
plugins: [
'gatsby-plugin-printer',
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-remark-images',
{
resolve: 'gatsby-plugin-layout',
options: {
component: require.resolve(`./src/layouts/layout.js`),
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
globalScope: `
import ResponsiveEmbed from "react-responsive-embed";
import { TwitterTweetEmbed } from "react-twitter-embed";
export default { ResponsiveEmbed, TwitterTweetEmbed };
`,
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 900,
linkImagesToOriginal: false,
wrapperStyle: {
float: 'left',
},
},
},
],
},
},
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: /content/,
},
},
},
'gatsby-transformer-remark',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-source-filesystem',
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
ignore: [`**/\.*`], // ignore files starting with a dot
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/content/illustratednotes/`,
name: 'illustrated notes',
ignore: [`**/\.*`], // ignore files starting with a dot,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/content/explainers/`,
name: 'explainers',
ignore: [`**/\.*`], // ignore files starting with a dot,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: '',
head: true,
},
},
'gatsby-plugin-emotion',
'gatsby-plugin-netlify',
{
resolve: `gatsby-plugin-manifest`,
options: {
name: 'Illustrated.dev',
short_name: 'Illustrated.dev',
background_color: '#7A44BB',
theme_color: '#7A44BB',
display: 'minimal-ui',
icon: 'src/images/id_favicon.svg', // This path is relative to the root of the site.
},
},
{
resolve: 'gatsby-plugin-web-font-loader',
options: {
typekit: {
id: 'vre2jfc',
families: [
'FF Tisa Web Pro:300,400,700',
'Brandon Grotesque:400,700',
'Freight Sans Pro:300,400,600',
],
},
},
},
{
resolve: `gatsby-plugin-feed`,
options: {
// this base query will be merged with any queries in each feed
query: `
{
site {
siteMetadata {
title
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMdx } }) => {
return allMdx.edges.map((edge) => {
return Object.assign({}, edge.node.frontmatter, {
description: edge.node.frontmatter.description,
image_url: `https://${site.siteMetadata.title}/images/id_favicon.svg`,
url: `https://${site.siteMetadata.title}/${edge.node.frontmatter.slug}`,
guid: `https://${site.siteMetadata.title}/${edge.node.frontmatter.slug}`,
enclosure: {
url: `${site.siteMetadata.title}${edge.node.frontmatter.thumbnail.childImageSharp.original.src}`,
},
custom_elements: [{ 'content:encoded': edge.node.html }],
})
})
},
query: `
{
allMdx(
sort: { order: ASC, fields: [frontmatter___featured, frontmatter___date] }
filter: { fields: { category: { eq: "explainers" } } }
) {
edges {
node {
id
html
fields {
slug
}
frontmatter {
slug
title
description
category
featured
thumbnail {
childImageSharp {
original {
src
}
}
}
}
}
}
}
}
`,
output: '/rss.xml',
title: 'Illustrated.dev',
},
],
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.app/offline
// 'gatsby-plugin-offline',
],
}