-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgatsby-config.js
171 lines (166 loc) · 4.69 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
// needs to be at the top of the file.
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
const remarkSlug = require('remark-slug');
const config = require('./meta/config');
const pathPrefix = config.pathPrefix === '/' ? '' : config.pathPrefix;
const ENABLE_SEARCH_INDEXING = process.env.ENABLE_SEARCH_INDEXING === 'true';
const REMARK_MAX_WIDTH = 1035;
module.exports = {
siteMetadata: {
title: config.siteTitle,
siteUrl: config.siteUrl,
rssMetadata: {
site_url: config.siteUrl + pathPrefix,
feed_url: config.siteUrl + pathPrefix + config.siteRss,
title: config.siteTitle,
description: config.siteDescription,
image_url: `${config.siteUrl + pathPrefix}/icons/icon-512x512.png`,
author: config.userName,
copyright: config.copyright,
},
},
plugins: [
'gatsby-plugin-react-helmet', // adds meta tags
'gatsby-plugin-remove-serviceworker', // Supposedly this fixes possible caching issues. https://stackoverflow.com/a/56548989/5378196
// Google Analytics
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'docs',
path: `${__dirname}/markdown/documentation`,
},
},
'gatsby-remark-images',
{
resolve: 'gatsby-plugin-mdx',
options: {
// required for headings table of contents
// adds ID to H# tags
remarkPlugins: [remarkSlug],
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: REMARK_MAX_WIDTH,
},
},
{
// copies over *any* random files you linked to
// from a markdown page
resolve: 'gatsby-remark-copy-linked-files',
},
],
extensions: ['.mdx', '.md'],
plugins: ['gatsby-remark-images'],
},
},
'gatsby-transformer-remark',
{
resolve: `gatsby-transformer-yaml`,
options: {
typeName: 'Yaml',
},
},
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
// /src/pages is a "gatsby thing".
// these pages are created based on folder structure.
// e.g. pages/index.js is the homepage.
name: 'pages',
},
},
{
resolve: `gatsby-plugin-sitemap`,
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/img`,
name: 'images',
},
},
'gatsby-plugin-sharp',
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
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: REMARK_MAX_WIDTH,
},
},
],
},
},
'gatsby-transformer-sharp',
{
resolve: `gatsby-plugin-nprogress`,
options: {
// Setting a color is optional.
color: config.themeColor,
// Disable the loading spinner.
showSpinner: false,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: config.siteTitle,
short_name: config.siteTitleAlt,
start_url: '/',
background_color: config.backgroundColor,
theme_color: config.themeColor,
display: 'standalone',
icons: [
{
src: `/icons/icon-192x192.png`,
sizes: `192x192`,
type: `image/png`,
},
{
src: `/icons/icon-512x512.png`,
sizes: `512x512`,
type: `image/png`,
},
],
},
},
'gatsby-plugin-netlify',
// {
// resolve: 'gatsby-plugin-algolia',
// options: {
// apiKey: process.env.ALGOLIA_ADMIN_API_KEY,
// appId: process.env.GATSBY_ALGOLIA_APP_ID,
// chunkSize: 10000, // default 1000
// indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME, // for all queries
// queries: require('./meta/algolia-queries.js'),
// skipIndexing: !ENABLE_SEARCH_INDEXING,
// },
// },
{
resolve: 'gatsby-plugin-anchor-links',
options: {
offset: -200,
},
},
{
resolve: 'gatsby-plugin-matomo',
options: {
siteId: process.env.GATSBY_MATOMO_SITE_ID,
matomoUrl: process.env.GATSBY_MATOMO_URL,
siteUrl: process.env.GATSBY_MATOMO_SITE_URL,
// set variable dev to true when testing in dev
dev: process.env.NODE_ENV === 'development',
},
},
],
};