This repository was archived by the owner on Jan 31, 2025. It is now read-only.
generated from gatsbyjs/gatsby-starter-default
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
190 lines (188 loc) · 4.9 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
const siteUrl = 'https://gatsby-starter-netlify-tailwind.netlify.app/'
const title = 'Gatsby Starter Netlify Tailwind'
const description =
'This repo contains an example blog website that is built with Gatsby, and Netlify CMS.It follows the JAMstack architecture by using Git as a single source of truth, and Netlify for continuous deployment, and CDN distribution.'
const logo = '/img/logo.png'
const srcLogo = 'src/images/gatsby-icon.png'
const color = '#433e85'
const social = {
twitter: 'gautier_manu',
instagram: '',
youtube: '',
github: 'emmanuelgautier',
linkedin: 'emmanuelgautier1',
}
const gtagId = 'G-V165P2CKRK'
module.exports = {
siteMetadata: {
siteUrl,
logo,
title,
description,
color,
social,
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-postcss',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/static/img`,
name: 'uploads',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/content`,
name: 'pages',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/images`,
name: 'images',
},
},
`gatsby-plugin-image`,
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-relative-images',
options: {
staticFolderName: 'static',
},
},
{
resolve: 'gatsby-remark-images',
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 2048,
linkImagesToOriginal: true,
loading: 'lazy',
showCaptions: true,
disableBgImage: true,
withWebp: true,
},
},
{
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: 'static',
},
},
'gatsby-remark-smartypants',
],
},
},
'gatsby-plugin-catch-links',
{
resolve: 'gatsby-plugin-netlify-cms',
options: {
modulePath: `${__dirname}/src/cms/cms.js`,
},
},
{
resolve: 'gatsby-plugin-next-seo',
options: {
title,
language: 'en',
description,
canonical: siteUrl,
openGraph: {
type: 'website',
locale: 'en_US',
url: siteUrl,
description,
title,
site_name: title,
},
twitter: {
site: social.twitter,
cardType: 'summary_large_image',
},
},
},
{
resolve: `gatsby-plugin-feed`,
options: {
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.frontmatter.description,
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(
sort: { order: DESC, fields: [frontmatter___date] }
filter: { frontmatter: { templateKey: { eq: "blog-post" } } }
) {
edges {
node {
html
fields { slug }
frontmatter {
title
description
date
}
}
}
}
}
`,
output: '/rss.xml',
title: 'Blog RSS Feed',
},
],
},
},
'gatsby-plugin-sitemap',
{
resolve: `gatsby-plugin-google-gtag`,
options: {
trackingIds: [gtagId],
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: title,
short_name: title,
start_url: `/`,
background_color: `#ffffff`,
theme_color: color,
display: `minimal-ui`,
icon: srcLogo,
},
},
],
}