-
Notifications
You must be signed in to change notification settings - Fork 21
/
gatsby-config.js
169 lines (161 loc) · 4.63 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
/*
* Human Cell Atlas
* https://www.humancellatlas.org/
*
* Gatsby configuration file.
*/
// Template variables
let contentPath = `${__dirname}/content`;
let metadataSchemaDocsPath = `${__dirname}/_metadata-schema/docs`;
let siteMapPath = `${__dirname}/site-map`;
if (process.env.GATSBY_ENV == "LOCAL") {
console.log("LAUNCHING USING LOCAL CONFIG");
contentPath = "./content";
metadataSchemaDocsPath = "../hca-metadata-schema/docs";
}
let gtmId = process.env.GATSBY_GTM_ID;
let gtmAuth = process.env.GATSBY_GTM_AUTH;
let gtmEnvName = process.env.GATSBY_ENV_NAME;
const lungmap = process.env.GATSBY_ATLAS === "lungmap";
const siteMetadata = lungmap
? {
title: "LungMAP Data Browser",
siteUrl: "https://data-browser.lungmap.net",
}
: {
title: "HCA Data Portal",
siteUrl: "https://data.humancellatlas.org",
};
module.exports = {
siteMetadata,
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,
},
},
`gatsby-plugin-react-svg`,
`gatsby-plugin-sitemap`,
`gatsby-source-metadata`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: contentPath,
name: "markdown-pages",
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: metadataSchemaDocsPath,
name: "metadata-markdown-pages",
},
},
`gatsby-transformer-yaml`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: siteMapPath,
},
},
{
resolve: "gatsby-plugin-manifest",
options: {
background_color: "#f4f7f9",
display: "standalone",
icon: lungmap
? "./images/lungmap/favicon/favicon.png"
: "./images/favicon/favicon.png",
name: lungmap ? "LungMAP Data Browser" : "HCA Data Portal",
short_name: lungmap ? "LungMAP" : "HCA DP",
start_url: "/",
theme_color: lungmap ? "#005295" : "#1c7cc7",
},
},
{
resolve: `gatsby-plugin-sharp`,
options: {
defaults: {
quality: 100,
},
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
excerpt_separator: `<!-- end -->`,
plugins: [
`gatsby-remark-component`,
{
resolve: `gatsby-remark-component-parent2div`,
options: {
components: [
"button-cta",
"figure-styles",
"internal-link",
"link-to-browser",
"metadata-type-entity-schemas",
"search-portal",
],
},
},
{
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, // Defaults to 16/9 = 1.77
height: 316,
width: 800,
related: false, // Removes related videos from the end of an embedded YouTube video.
},
},
{
resolve: `gatsby-remark-external-links`,
options: {
target: "_blank",
rel: "noopener",
},
},
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1000,
linkImagesToOriginal: false,
quality: 100,
wrapperStyle:
"box-shadow: 0 12px 24px -4px rgb(0 0 0 / 14%), 0 8px 16px -8px rgb(0 0 0 / 24%), 0 -6px 16px -6px rgb(0 0 0 / 24%); margin-bottom: 48px; margin-top: 48px;",
},
},
`gatsby-remark-images-medium-zoom`,
`gatsby-remark-katex`,
`gatsby-remark-prismjs`,
`gatsby-remark-responsive-iframe`,
`gatsby-remark-metadata-absolute-linker`,
`gatsby-remark-relative-linker`,
`gatsby-remark-autointernallink-headers`,
],
},
},
// `gatsby-plugin-catch-links`,
"gatsby-plugin-react-helmet",
{
resolve: "gatsby-plugin-typography",
options: {
pathToConfigModule: "src/utils/typography.js",
},
},
],
};