This repository has been archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
151 lines (143 loc) · 4.11 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
require(`dotenv`).config({ path: `.env` })
const NETLIFY_ENV = process.env.CONTEXT || process.env.NODE_ENV
const URL = process.env.URL
const lang = `en`
const name = `GatsbyJS Starter by Odd Camp`
const shortName = name // change this if `name` is longer than 12 characters
const title = `With love by Odd Camp`
const titlePattern = `[PAGE_TITLE] — [SITE_NAME]`
const description = `Odd Camp GatsbyJS starter`
const socialImage = `/meta-images/social.jpg` // 1600x840
const robotsNoFollow = false
const robotsNoIndex = false
const fbAppId = ``
const twitterHandle = `@odd_camp`
// meta icons and colors
const colorBrand = `#663399`
const colorBackground = `#fff`
const iconBgTransparent = `/meta-images/icon-bg-transparent.png` // 512x512; no padding around, transparent background
const iconBgColored = `/meta-images/icon-bg-colored.png` // 512x512; with minor padding, color background
// favicon
const favIcon = iconBgTransparent
// manifest
const manifestIcon = iconBgTransparent
const manifestThemeColor = colorBrand
const manifestBgColor = colorBackground
// apple
const appleTouchIcon = iconBgColored
const appleStatusBarStyle = `#222` // how to: https://medium.com/appscope/changing-the-ios-status-bar-of-your-progressive-web-app-9fc8fbe8e6ab
const appleMaskIcon = `/meta-images/mask-icon.svg` // how to: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html
const appleMaskIconColor = colorBrand
const appleWebAppCapable = `yes`
// microsoft
const msTileIcon = iconBgTransparent
const msTileColor = colorBackground // background color of the tile
module.exports = {
siteMetadata: {
lang,
name,
title,
titlePattern,
description,
robotsNoFollow,
robotsNoIndex,
socialImage,
fbAppId,
twitterHandle,
favIcon,
appleTouchIcon,
appleStatusBarStyle,
appleWebAppCapable,
appleMaskIcon,
appleMaskIconColor,
msTileIcon,
msTileColor,
siteUrl: URL, // gatsby-plugin-robots-txt
},
plugins: [
{
resolve: `gatsby-plugin-env-variables`,
options: {
allowList: [`URL`],
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
lang: lang,
name: name,
short_name: shortName,
description: description,
theme_color: manifestThemeColor,
background_color: manifestBgColor,
icon: `static${manifestIcon}`,
start_url: `/`,
display: `standalone`,
cache_busting_mode: `none`,
include_favicon: false, // carried out via Meta component instead
legacy: false, // carried out via Meta component instead
},
},
{
resolve: `gatsby-plugin-robots-txt`,
options: {
options: {
resolveEnv: () => NETLIFY_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-svgr`,
options: {
prettier: true,
svgo: true,
svgoConfig: {
plugins: [
{ removeViewBox: false },
{ removeDimensions: true },
{ cleanupIDs: true },
],
},
},
},
{
resolve: `gatsby-plugin-sass`,
options: {
sassOptions: {
includePaths: [`node_modules`],
},
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `content-images`,
path: `${__dirname}/content/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-eslint`,
`gatsby-plugin-sitemap`,
// `gatsby-plugin-offline`,
// `gatsby-plugin-remove-serviceworker`,
],
}