forked from DataBiosphere/data-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
201 lines (190 loc) · 4.51 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*
* Human Cell Atlas
* https://www.humancellatlas.org/
*
* Gatsby configuration file.
*/
// gatsby-config.js
let contentPath = `${__dirname}/content`;
let metadataSchemaDocsPath = `${__dirname}/_metadata-schema/docs`;
let metadataSchemaJsonPath = `${__dirname}/_metadata-schema/json_schema`;
let hcaGithubSystemStatusDocsPath = `${__dirname}/humancellatlas.github.io`;
let yamlPath = `${__dirname}/content`;
if (process.env.GATSBY_ENV == "LOCAL") {
console.log("LAUNCHING USING LOCAL CONFIG");
contentPath = './content';
yamlPath = './content';
metadataSchemaDocsPath = '../hca-metadata-schema/docs';
metadataSchemaJsonPath = '../hca-metadata-schema/json_schema';
hcaGithubSystemStatusDocsPath = '../humancellatlas.github.io';
}
let gtmId = process.env.GATSBY_GTM_ID;
let gtmAuth = process.env.GATSBY_GTM_AUTH;
let gtmEnvName = process.env.GATSBY_ENV_NAME;
module.exports = {
siteMetadata: {
title: 'HCA Data Portal'
},
plugins: [
{
resolve: `gatsby-plugin-google-tagmanager`,
options: {
id: gtmId,
// Include GTM in development.
// Defaults to false meaning GTM will only be loaded in production.
includeInDevelopment: false,
// Specify optional GTM environment details.
gtmAuth: gtmAuth,
gtmPreview: gtmEnvName,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: contentPath,
name: 'markdown-pages',
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: metadataSchemaDocsPath,
name: 'metadata-markdown-pages',
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: hcaGithubSystemStatusDocsPath,
name: 'system-status-markdown-pages',
}
},
`gatsby-transformer-json-schema`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: metadataSchemaJsonPath,
name: 'json-schema',
},
},
`gatsby-transformer-json-system-status`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: hcaGithubSystemStatusDocsPath,
name: 'json-system-status',
},
},
`gatsby-transformer-yaml`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: yamlPath,
},
},
{
resolve: `gatsby-plugin-favicon`,
options: {
logo: './images/favicon/favicon.png',
// WebApp Manifest Configuration
appName: 'Gatsby site',
appDescription: null,
developerName: null,
developerURL: null,
dir: 'auto',
lang: 'en-US',
background: '#fff',
theme_color: '#fff',
display: 'standalone',
orientation: 'any',
start_url: '/?homescreen=1',
version: '1.0',
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: false,
yandex: false,
windows: false
}
}
},
{
resolve: 'gatsby-plugin-react-css-modules',
options: {
filetypes: {
'.scss': {syntax: 'postcss-scss'},
},
// Exclude global styles from the plugin
exclude: '\/global\/'
}
},
{
resolve: `gatsby-plugin-sharp`,
options: {
quality: 100
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
excerpt_separator: `<!-- end -->`,
plugins: [
{
resolve: `gatsby-remark-autolink-headers`,
options: {
offsetY: '-84', // header + 24px, ignores top banner.
},
},
{
resolve: `gatsby-remark-copy-linked-files`,
options: {
// don't copy linked markdown files but do the normal skipping of images so they can be handled by gatsby-remark-images
ignoreFileExtensions: ['png', 'jpg', 'jpeg', 'bmp', 'tiff', 'md'],
}
},
{
resolve: `gatsby-remark-embed-video`,
options: {
ratio: 1.77, // Optional: Defaults to 16/9 = 1.77
height: 316,
width: 560,
related: false //Optional: Will remove related videos from the end of an embedded YouTube video.
}
},
{
resolve: `gatsby-remark-external-links`,
options: {
target: '_blank',
rel: 'nofollow'
}
},
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 640,
linkImagesToOriginal: false
}
},
`gatsby-remark-images-medium-zoom`,
`gatsby-remark-katex`,
`gatsby-remark-prismjs`,
`gatsby-remark-responsive-iframe`,
'gatsby-remark-relative-linker'
],
},
},
// `gatsby-plugin-catch-links`,
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-typography',
options: {
pathToConfigModule: 'src/utils/typography.js'
}
}
]
};