forked from g00glen00b/dimitri.codes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
170 lines (168 loc) · 4.8 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
const {feedItemQuery, getFeedItem, siteMetadataQuery} = require('./src/helpers/node/feedHelpers');
const environment = process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || 'development';
require('dotenv').config({path: `.env.${environment}`});
module.exports = {
siteMetadata: {
title: `Dimitri's tutorials`,
description: `Dimitri's tutorials about software development with Java and JavaScript`,
authorName: 'Dimitri Mestdagh',
author: `@g00glen00b`,
siteUrl: process.env.SITE_URL,
headerLinks: [
{name: 'Home', to:'/'},
{name: 'Tutorials', to: '/category/tutorials'},
{name: 'Speaking', to: '/speaking'},
{name: 'About me', to: '/about-me'}
],
footerLinks: [
{name: 'Privacy policy', to: '/privacy-policy'},
{name: 'Post an idea', to: 'https://github.com/g00glen00b/gatsby-blog/issues', outbound: true},
{name: 'Contact', to: '/contact'},
{name: 'RSS', to: 'https://dimitr.im/rss.xml', outbound: true}
],
socialNetworks: {
github: 'g00glen00b',
codepen: 'g00glen00b',
twitter: 'g00glen00b',
speakerdeck: 'g00glen00b'
}
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1024,
backgroundColor: `transparent`,
linkImagesToOriginal: false
}
},
{
resolve: `gatsby-remark-external-links`,
options: {
target: '_blank',
rel: 'noopener noreferrer'
}
},
`gatsby-remark-copy-linked-files`,
{
resolve: `gatsby-remark-autolink-headers`,
options: {
isIconAfterHeader: true
}
},
{
resolve: `gatsby-remark-prismjs`,
options: {
noInlineHighlight: true
}
},
`gatsby-remark-smartypants`
]
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/content/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/content/posts`,
},
},
{
resolve: `gatsby-plugin-react-svg`,
options: {
rule: {
include: /images\/.+?\.svg$/
}
}
},
{
resolve: `gatsby-plugin-prefetch-google-fonts`,
options: {
fonts: [{
family: `Roboto`,
variants: [`400`, `500`]
}, {
family: `Roboto Mono`,
variants: [`400`, `700`]
}, {
family: `Montserrat`,
variants: [`600`, `700`]
}]
}
},
`gatsby-plugin-advanced-sitemap`,
{
resolve: `gatsby-plugin-feed`,
options: {
query: siteMetadataQuery,
feeds: [{
serialize: ({query: {site, allMarkdownRemark}}) => allMarkdownRemark.edges.map(({node}) => getFeedItem(site, node)),
query: feedItemQuery,
output: `/rss.xml`,
title: `Dimitri's tutorial RSS feed`
}]
}
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Dimitri's tutorials`,
short_name: `Dimitri\'s tutorials`,
start_url: `/`,
background_color: `#FFFFFF`,
theme_color: `#3E84CB`,
display: `standalone`,
icon: `content/images/logo-square.svg`,
include_favicon: false
}
},
{
resolve: `gatsby-plugin-offline`,
options: {
workboxConfig: {
offlineGoogleAnalytics: true,
runtimeCaching: [{
urlPattern: /(\.js$|\.css$|static\/)/,
handler: `CacheFirst`
}, {
urlPattern: /^https?:.*\/page-data\/.*\/(page-data|app-data)\.json$/,
// Default is `StaleWhileRevalidate`, which causes stale data to appear
// The reason this is applied is to increase performance.
// To still allow immediate live data, without losing much performance, we're using `NetworkFirst` with a timeout of 1 second.
// If we're unable to fetch the page data within that time, we'll rely on cache.
handler: `NetworkFirst`,
options: {
networkTimeoutSeconds: 1
}
}]
}
}
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: process.env.GOOGLE_TRACKING_ID,
head: false,
anonymize: true,
respectDNT: true
}
},
`gatsby-plugin-robots-txt`,
`gatsby-plugin-netlify`,
`gatsby-plugin-eslint`
],
};