-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
169 lines (164 loc) · 4.46 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
require(`dotenv`).config({
path: `.env.${process.env.NODE_ENV}`,
})
const contentfulConfig = {
spaceId: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
}
// if you want to use the preview API please define
// CONTENTFUL_HOST in your environment config
// the `host` property should map to `preview.contentful.com`
// https://www.contentful.com/developers/docs/references/content-preview-api/#/reference/spaces/space/get-a-space/console/js
if (process.env.CONTENTFUL_HOST) {
contentfulConfig.host = process.env.CONTENTFUL_HOST
}
const { spaceId, accessToken } = contentfulConfig
if (!spaceId || !accessToken) {
throw new Error(
`Contentful spaceId and the access token need to be provided.`
)
}
module.exports = {
siteMetadata: {
title: `zoltansimon.me blog - contact - portfolio`,
description: `Thing`,
siteUrl: `https://zoltansimon.me/`,
author: `@zsim0n`,
social: {
twitter: `zsim0n`,
github: `zsim0n`,
linkedin: `zoltansimon27`,
},
},
plugins: [
`gatsby-plugin-sharp`,
`gatsby-plugin-image`,
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-images-contentful`,
options: {
maxWidth: 1035,
sizeByPixelDensity: false,
linkImagesToOriginal: false,
},
},
],
plugins: [`gatsby-remark-images-contentful`],
},
},
`gatsby-plugin-react-helmet`,
`gatsby-plugin-robots-txt`,
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `zoltansimon-me`,
short_name: `zoltansimon-me`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/favicon.png`,
},
},
{
resolve: `gatsby-plugin-webfonts`,
options: {
fonts: {
google: [
{
family: `Roboto`,
variants: [`300`, `400`, `500`],
// subsets: ['latin']
// text: 'Hello'
// fontDisplay: 'swap',
// strategy: 'selfHosted' // 'base64' || 'cdn'
},
],
},
// formats: ['woff2', 'woff'],
// useMinify: true,
// usePreload: true,
// usePreconnect: false,
},
},
`gatsby-plugin-material-ui`,
{
resolve: `gatsby-plugin-material-ui`,
// If you want to use styled components, in conjunction to Material-UI, you should:
// - Change the injection order
// - Add the plugin
// options: {
// stylesProvider: {
// injectFirst: true,
// },
// },
},
// 'gatsby-plugin-styled-components',
{
resolve: `gatsby-source-contentful`,
options: contentfulConfig,
},
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allContentfulPost } }) => {
return allContentfulPost.edges.map(node => {
return {
title: node.node.title.title,
date: node.node.date,
description: node.node.excerpt?.excerpt,
url:
site.siteMetadata.siteUrl +
node.node.stackbit_url_path?.stackbit_url_path,
guid:
site.siteMetadata.siteUrl +
node.node.stackbit_url_path?.stackbit_url_path,
}
})
},
query: `{
allContentfulPost(sort: { fields: date, order: DESC }) {
edges {
node {
contentful_id
date
excerpt {
excerpt
}
title {
title
}
stackbit_url_path {
stackbit_url_path
}
}
}
}
}
`,
output: `/rss.xml`,
title: `zoltansimon.me - RSS Feed`,
match: `^/blog/`,
},
],
},
},
],
}