-
Notifications
You must be signed in to change notification settings - Fork 34
/
gatsby-config.js
112 lines (112 loc) Β· 3.52 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
module.exports = {
siteMetadata: {
title: `Gatsby Tutorials`,
description: `Gatsby Tutorials is a community-updated list of video, audio and written tutorials to help you learn GatsbyJS. π©βπ»`,
siteUrl: `https://www.gatsbytutorials.com`, // no slash at the end
language: `en`,
locale: `en_CA`,
twitterHandle: ``,
facebookAppId: ``,
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `src`,
path: `${__dirname}/src/`,
},
},
{
resolve: `gatsby-source-apiserver`,
options: {
url: `https://api.github.com/repos/ooloth/gatsbytutorials.com/contributors`,
name: `contributors`,
verboseOutput: process.env.NODE_ENV !== `production`,
},
},
{
resolve: `gatsby-plugin-remote-images`,
options: {
nodeType: `contributors`,
imagePath: `avatar_url`,
name: `avatarImage`,
},
},
`gatsby-plugin-typescript`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sharp`,
`gatsby-plugin-svgr`,
`gatsby-transformer-yaml`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-robots-txt`,
// Disable crawlers for Netlify deploy-previews:
options: {
resolveEnv: () => process.env.NODE_ENV,
env: {
production: {
policy: [{ userAgent: `*` }],
},
'branch-deploy': {
policy: [{ userAgent: `*`, disallow: [`/`] }],
sitemap: null,
host: null,
},
'deploy-preview': {
policy: [{ userAgent: `*`, disallow: [`/`] }],
sitemap: null,
host: null,
},
},
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Gatsby Tutorials`,
short_name: `Gatsby Tuts`,
start_url: `/`,
// For splash screen when app launches:
background_color: `#603894`,
// For tool bar and task switcher:
theme_color: `#603894`,
display: `minimal-ui`,
// Multiple icons will be generated for various devices.
// Multiple favicons will be generated and added to each HTML page.
// This path is relative to the root of the site.
icon: `src/images/favicon.png`,
},
},
// remove old service worker versions in Safari π§¨
`gatsby-plugin-remove-serviceworker`,
// `gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: 'UA-9710963-7',
head: true, // Puts tracking script in the head instead of the body
anonymize: true, // Setting this parameter is optional
respectDNT: true, // Setting this parameter is also optional
},
},
`gatsby-plugin-netlify-cache`,
{
resolve: `gatsby-plugin-netlify`, // must come last
options: {
headers: {
// First one is required for the HSTS list:
'/*': [
`Strict-Transport-Security: max-age=63072000; includeSubDomains; preload`,
],
'/*.html': [`Cache-Control: public, max-age=0, must-revalidate`],
'/*.js': [`Cache-Control: public, max-age=0, must-revalidate`],
'/sw.js': [`Cache-Control: max-age=0, no-cache, no-store, must-revalidate`],
'/icons/*': [`Cache-Control: public,max-age=31536000,immutable`],
'/static/*': [`Cache-Control: public,max-age=31536000,immutable`],
},
},
},
],
}