forked from stjudecloud/university
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
215 lines (208 loc) · 14.6 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
require("dotenv").config()
let plugins = [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `config`,
path: `${__dirname}/src/config`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `docs`,
path: `${__dirname}/docs`,
},
},
/** Transformers */
`gatsby-transformer-yaml`,
`gatsby-transformer-sharp`,
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /src\/images\/.*\.svg/,
omitKeys: [
"xmlnsDc",
"xmlnsCc",
"xmlnsRdf",
"xmlnsSvg",
"xmlnsSodipodi",
"xmlnsInkscape",
],
},
},
},
/** Other Plugins */
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
commonmark: true,
footnotes: true,
pedantic: true,
gfm: true,
plugins: [
{
resolve: `gatsby-remark-table-of-contents`,
options: {
exclude: "Table of Contents",
tight: false,
ordered: false,
fromHeading: 1,
toHeading: 6,
className: "table-of-contents",
},
},
{
resolve: `gatsby-remark-autolink-headers`,
options: {
offsetY: 85,
icon: `<svg height="512pt" viewBox="-31 0 512 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m30 316c-16.570312 0-30 13.429688-30 30 0 16.566406 13.429688 30 30 30h59l-14 106c0 16.566406 13.429688 30 30 30s30-13.433594 30-30l14-106h120l-14 106c0 16.566406 13.429688 30 30 30s30-13.433594 30-30l14-106h61c16.570312 0 30-13.433594 30-30 0-16.570312-13.429688-30-30-30h-53l16-120h67c16.570312 0 30-13.433594 30-30 0-16.570312-13.429688-30-30-30h-59l14-106c0-16.570312-13.429688-30-30-30s-30 13.429688-30 30l-14 106h-120l14-106c0-16.570312-13.429688-30-30-30s-30 13.429688-30 30l-14 106h-61c-16.570312 0-30 13.429688-30 30 0 16.566406 13.429688 30 30 30h53l-16 120zm143-120h120l-16 120h-120zm0 0"/></svg>`,
},
},
{
resolve: `gatsby-remark-copy-linked-files`,
options: {
ignoreFileExtensions: [`png`, `jpg`, `jpeg`, `bmp`, `tiff`, `md`],
},
},
{
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: 1180,
withWebp: true,
loading: "eager",
},
},
{
resolve: `gatsby-remark-vscode`,
options: {
theme: "Monokai",
},
},
{
resolve: `gatsby-remark-admonitions`,
options: {
customTypes: {
warning: {
svg:
'<svg xmlns="http://www.w3.org/2000/svg" height="512" viewBox="0 0 20 20" width="512"><g><path d="m9 5h2v7h-2z"/><path d="m9 13h2v2h-2z"/><path d="m10 0c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10zm0 18c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"/></g></svg>',
},
note: {
svg:
'<svg height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m512 334.667v-314.667c0-11.046-8.954-20-20-20h-472c-11.046 0-20 8.954-20 20v472c0 11.046 8.954 20 20 20h314.667c5.375 0 10.489-2.203 14.145-5.86l157.328-157.329c3.652-3.65 5.86-8.747 5.86-14.144zm-472-294.667h432v274.667h-137.333c-11.046 0-20 8.954-20 20v137.333h-274.667zm403.716 314.667-89.049 89.049v-89.049zm-325.716-177.334c0-11.046 8.954-20 20-20h236c11.046 0 20 8.954 20 20s-8.954 20-20 20h-236c-11.046 0-20-8.954-20-20zm20 98.667c-11.046 0-20-8.954-20-20s8.954-20 20-20h236c11.046 0 20 8.954 20 20s-8.954 20-20 20z"/></svg>',
},
info: {
svg:
'<svg height="512" viewBox="0 0 24 24" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m12 1a11 11 0 1 0 11 11 11.013 11.013 0 0 0 -11-11zm0 20a9 9 0 1 1 9-9 9.011 9.011 0 0 1 -9 9z"/><path d="m12 9a1 1 0 0 0 -1 1v7a1 1 0 0 0 2 0v-7a1 1 0 0 0 -1-1z"/><circle cx="12" cy="7" r="1"/></svg>',
},
tip: {
svg:
'<svg enable-background="new 0 0 24 24" height="512" viewBox="0 0 24 24" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m13.5 24h-3c-.7 0-1.5-.6-1.5-1.8v-2.1c0-1-.5-1.9-1.3-2.6-1.8-1.4-2.7-3.4-2.7-5.6.1-3.8 3.2-6.8 6.9-6.9 1.9 0 3.7.7 5 2s2.1 3.1 2.1 5c0 2.1-.9 4.1-2.6 5.4-.9.7-1.4 1.8-1.4 2.8v2.3c0 .8-.7 1.5-1.5 1.5zm-1.5-18c-3.2 0-5.9 2.7-6 5.9 0 1.9.8 3.7 2.3 4.8 1.1.9 1.7 2.1 1.7 3.4v2.1c0 .2 0 .8.5.8h3c.3 0 .5-.2.5-.5v-2.3c0-1.3.7-2.7 1.8-3.6 1.4-1.1 2.2-2.8 2.2-4.6 0-1.6-.6-3.1-1.8-4.3-1.1-1.1-2.6-1.7-4.2-1.7z"/></g><g><path d="m14.5 21h-5c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h5c.3 0 .5.2.5.5s-.2.5-.5.5z"/></g><g><path d="m12 3c-.3 0-.5-.2-.5-.5v-2c0-.3.2-.5.5-.5s.5.2.5.5v2c0 .3-.2.5-.5.5z"/></g><g><path d="m18.7 5.8c-.1 0-.3 0-.4-.1-.2-.2-.2-.5 0-.7l1.4-1.4c.2-.2.5-.2.7 0s.2.5 0 .7l-1.4 1.4s-.2.1-.3.1z"/></g><g><path d="m23.5 12.5h-2c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h2c.3 0 .5.2.5.5s-.2.5-.5.5z"/></g><g><path d="m20.1 20.6c-.1 0-.3 0-.4-.1l-1.4-1.4c-.2-.2-.2-.5 0-.7s.5-.2.7 0l1.4 1.4c.2.2.2.5 0 .7 0 .1-.1.1-.3.1z"/></g><g><path d="m3.9 20.6c-.1 0-.3 0-.4-.1-.2-.2-.2-.5 0-.7l1.4-1.4c.2-.2.5-.2.7 0s.2.5 0 .7l-1.4 1.4c-.1.1-.2.1-.3.1z"/></g><g><path d="m2.5 12.5h-2c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h2c.3 0 .5.2.5.5s-.2.5-.5.5z"/></g><g><path d="m5.3 5.8c-.1 0-.3 0-.4-.1l-1.4-1.5c-.2-.2-.2-.5 0-.7s.5-.2.7 0l1.4 1.4c.2.2.2.5 0 .7-.1.1-.2.2-.3.2z"/></g><g><path d="m16 12.5c-.3 0-.5-.2-.5-.5 0-1.9-1.6-3.5-3.5-3.5-.3 0-.5-.2-.5-.5s.2-.5.5-.5c2.5 0 4.5 2 4.5 4.5 0 .3-.2.5-.5.5z"/></g></svg>',
},
example: {
svg:
'<svg height="512" viewBox="0 0 64 64" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m27 62c3.51904 0 6.43231-2.6134 6.92017-6h10.66577l-1.29297 1.29297 1.41406 1.41406 3-3c.19531-.19531.29297-.45117.29297-.70703s-.09766-.51172-.29297-.70703l-3-3-1.41406 1.41406 1.29297 1.29297h-10.66577c-.48786-3.3866-3.40113-6-6.92017-6-3.85938 0-7 3.14014-7 7s3.14062 7 7 7zm0-12c2.75684 0 5 2.24316 5 5s-2.24316 5-5 5-5-2.24316-5-5 2.24316-5 5-5z"/><path d="m55 62c3.85938 0 7-3.14014 7-7s-3.14062-7-7-7-7 3.14014-7 7 3.14062 7 7 7zm0-12c2.75684 0 5 2.24316 5 5s-2.24316 5-5 5-5-2.24316-5-5 2.24316-5 5-5z"/><path d="m23 25c-3.51904 0-6.43225 2.6134-6.9201 6h-1.5799c-6.89258 0-12.5 5.60742-12.5 12.5s5.60742 12.5 12.5 12.5h2.08594l-1.29297 1.29297 1.41406 1.41406 3-3c.19531-.19531.29297-.45117.29297-.70703s-.09766-.51172-.29297-.70703l-3-3-1.41406 1.41406 1.29297 1.29297h-2.08594c-5.79004 0-10.5-4.71045-10.5-10.5s4.70996-10.5 10.5-10.5h1.5799c.48785 3.3866 3.40106 6 6.9201 6 3.85938 0 7-3.14014 7-7s-3.14062-7-7-7zm0 12c-2.75684 0-5-2.24316-5-5s2.24316-5 5-5 5 2.24316 5 5-2.24316 5-5 5z"/><path d="m26.70703 5.29297-1.41406 1.41406 1.29297 1.29297h-10.66577c-.48786-3.3866-3.40113-6-6.92017-6-3.85938 0-7 3.14014-7 7s3.14062 7 7 7c3.51904 0 6.43231-2.6134 6.92017-6h10.66577l-1.29297 1.29297 1.41406 1.41406 3-3c.19531-.19531.29297-.45117.29297-.70703s-.09766-.51172-.29297-.70703zm-17.70703 8.70703c-2.75684 0-5-2.24316-5-5s2.24316-5 5-5 5 2.24316 5 5-2.24316 5-5 5z"/><path d="m62 20.5c0-6.89258-5.60742-12.5-12.5-12.5h-5.57983c-.48786-3.3866-3.40113-6-6.92017-6-3.85938 0-7 3.14014-7 7s3.14062 7 7 7c3.51904 0 6.43231-2.6134 6.92017-6h5.57983c5.79004 0 10.5 4.71045 10.5 10.5s-4.70996 10.5-10.5 10.5h-16.08594l1.29297-1.29297-1.41406-1.41406-3 3c-.19531.19531-.29297.45117-.29297.70703s.09766.51172.29297.70703l3 3 1.41406-1.41406-1.29297-1.29297h16.08594c6.89258 0 12.5-5.60742 12.5-12.5zm-25-6.5c-2.75684 0-5-2.24316-5-5s2.24316-5 5-5 5 2.24316 5 5-2.24316 5-5 5z"/></svg>',
},
bug: {
svg:
'<svg xmlns="http://www.w3.org/2000/svg" width="512" height="511" viewBox="0 0 512 511"><path d="M282.666667,511 L229.333333,511 C149.930667,511 85.3333333,446.402667 85.3333333,367 L85.3333333,249.666667 C85.3333333,170.264 149.930667,105.666667 229.333333,105.666667 L282.666667,105.666667 C362.069333,105.666667 426.666667,170.264 426.666667,249.666667 L426.666667,367 C426.666667,446.402667 362.069333,511 282.666667,511 Z M229.333333,137.666667 C167.573333,137.666667 117.333333,187.906667 117.333333,249.666667 L117.333333,367 C117.333333,428.76 167.573333,479 229.333333,479 L282.666667,479 C344.426667,479 394.666667,428.76 394.666667,367 L394.666667,249.666667 C394.666667,187.906667 344.426667,137.666667 282.666667,137.666667 L229.333333,137.666667 Z"/><path d="M340.693333,151.533333 C338.176,151.533333 335.616,150.936 333.226667,149.677333 C325.418667,145.538667 322.432,135.874667 326.549333,128.045333 C329.216,123.032 330.666667,116.973333 330.666667,111 C330.666667,90.4133333 313.92,73.6666667 293.333333,73.6666667 L218.666667,73.6666667 C208.64,73.6666667 199.232,77.528 192.213333,84.5466667 C185.194667,91.5653333 181.333333,100.973333 181.333333,111 C181.333333,116.973333 182.784,123.032 185.450667,128.045333 C189.568,135.853333 186.602667,145.538667 178.773333,149.677333 C170.965333,153.816 161.301333,150.808 157.162667,143 C152.042667,133.336 149.333333,122.264 149.333333,111 C149.333333,92.4186667 156.522667,74.9893333 169.6,61.9333333 C182.677333,48.8773333 200.085333,41.6666667 218.666667,41.6666667 L293.333333,41.6666667 C331.562667,41.6666667 362.666667,72.7706667 362.666667,111 C362.666667,122.264 359.957333,133.336 354.837333,143 C351.978667,148.44 346.432,151.533333 340.693333,151.533333 L340.693333,151.533333 Z"/><path d="M219.157333 68.3333333C210.325333 68.3333333 203.157333 61.1653333 203.157333 52.3333333L203.157333 16.9413333C203.157333 8.10933333 210.325333.941333333 219.157333.941333333 227.989333.941333333 235.157333 8.10933333 235.157333 16.9413333L235.157333 52.3333333C235.157333 61.1653333 227.989333 68.3333333 219.157333 68.3333333zM293.824 68.3333333C284.992 68.3333333 277.824 61.1653333 277.824 52.3333333L277.824 16.9413333C277.824 8.10933333 284.992.941333333 293.824.941333333 302.656.941333333 309.824 8.10933333 309.824 16.9413333L309.824 52.3333333C309.824 61.1653333 302.656 68.3333333 293.824 68.3333333zM256 404.333333C247.168 404.333333 240 397.165333 240 388.333333L240 228.333333C240 219.501333 247.168 212.333333 256 212.333333 264.832 212.333333 272 219.501333 272 228.333333L272 388.333333C272 397.165333 264.832 404.333333 256 404.333333zM496 324.333333L416 324.333333C407.168 324.333333 400 317.165333 400 308.333333 400 299.501333 407.168 292.333333 416 292.333333L496 292.333333C504.832 292.333333 512 299.501333 512 308.333333 512 317.165333 504.832 324.333333 496 324.333333zM96 324.333333L16 324.333333C7.168 324.333333 0 317.165333 0 308.333333 0 299.501333 7.168 292.333333 16 292.333333L96 292.333333C104.832 292.333333 112 299.501333 112 308.333333 112 317.165333 104.832 324.333333 96 324.333333zM37.3333333 489.666667C32.448 489.666667 27.6266667 487.448 24.4693333 483.202667 19.2 476.098667 20.672 466.093333 27.776 460.824L96.6826667 409.624C103.765333 404.376 113.792 405.826667 119.061333 412.930667 124.330667 420.034667 122.858667 430.04 115.754667 435.309333L46.848 486.509333C44.0106667 488.642667 40.6613333 489.666667 37.3333333 489.666667zM405.781333 210.2C400.896 210.2 396.074667 207.981333 392.917333 203.736 387.648 196.632 389.12 186.626667 396.224 181.357333L465.130667 130.157333C472.213333 124.909333 482.24 126.36 487.509333 133.464 492.778667 140.568 491.306667 150.573333 484.202667 155.842667L415.296 207.042667C412.437333 209.176 409.088 210.2 405.781333 210.2L405.781333 210.2zM474.666667 489.666667C471.338667 489.666667 467.989333 488.642667 465.130667 486.509333L396.224 435.309333C389.12 430.04 387.648 420.013333 392.917333 412.930667 398.208 405.826667 408.234667 404.397333 415.296 409.624L484.202667 460.824C491.306667 466.093333 492.778667 476.12 487.509333 483.202667 484.373333 487.448 479.552 489.666667 474.666667 489.666667zM106.218667 210.2C102.890667 210.2 99.5413333 209.176 96.6826667 207.042667L27.776 155.842667C20.6933333 150.573333 19.2213333 140.546667 24.4906667 133.464 29.76 126.36 39.808 124.930667 46.8693333 130.157333L115.776 181.357333C122.88 186.626667 124.352 196.653333 119.082667 203.736 115.946667 207.96 111.104 210.2 106.218667 210.2z"/></svg>',
},
},
tag: "!!!",
icons: "svg",
},
},
`gatsby-plugin-catch-links`,
{
resolve: "gatsby-remark-external-links",
options: {
target: "_blank",
rel: "noopener",
},
},
`gatsby-remark-smartypants`,
],
},
},
{
resolve: `gatsby-plugin-sass`,
options: {
postCssPlugins: [require("tailwindcss"), require("./tailwind.config.js")],
},
},
`gatsby-plugin-sitemap`,
{
resolve: "gatsby-plugin-robots-txt",
options: {
env: {
development: {
policy: [{ userAgent: "*", disallow: ["/"] }],
},
production: {
policy: [{ userAgent: "*", allow: "/" }],
},
},
},
},
`gatsby-check-slugs`,
`gatsby-redirect-from`,
`gatsby-plugin-meta-redirect` // gatsby-plugin-meta-redirect must be last entry
]
if (process.env.INTERCOM_APP_ID) {
console.log(`Loading Intercom with app id: "${process.env.INTERCOM_APP_ID}"`)
plugins.push({
resolve: "gatsby-plugin-intercom-spa",
options: {
app_id: process.env.INTERCOM_APP_ID,
include_in_development: true,
delay_timeout: 500,
},
})
}
if (process.env.GATSBY_ALGOLIA_APP_ID) {
plugins.push({
resolve: `gatsby-plugin-algolia`,
options: {
appId: process.env.GATSBY_ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_ADMIN_KEY,
queries: require("./src/utils/algolia-queries"),
},
})
}
if (process.env.NODE_ENV === "production") {
const trackingId = "UA-107924368-1"
console.log(`Adding Google Analytics with ID ${trackingId}`)
console.log(`because NODE_ENV === 'production'.`)
plugins.push({
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId,
anonymize: true,
respectDNT: true,
},
})
} else {
console.log(`Skipping Google Analytics because NODE_ENV !== 'production'.`)
}
module.exports = {
siteMetadata: {
title: `St. Jude Cloud University`,
description: `A site containing all of the education material pertaining to St. Jude Cloud, the pediatric cancer data sharing ecosystem.`,
author: `St. Jude Cloud`,
siteUrl: `https://university.stjude.cloud`,
},
plugins,
}