-
Notifications
You must be signed in to change notification settings - Fork 71
/
gatsby-config.ts
437 lines (427 loc) · 14.1 KB
/
gatsby-config.ts
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
import type {GatsbyConfig} from "gatsby";
require("dotenv").config({
path: `.env`,
});
export const repo = `https://github.com/rsksmart/devportal.git`;
const siteUrl = process.env.URL || `https://dev.rootstock.io`
const config: GatsbyConfig = {
siteMetadata: {
title: `Rootstock Developers Portal`,
siteUrl,
description: 'Rootstock is the first open source Smart Contract platform secured by the Bitcoin Network. Rootstock adds value and expand functionality to the Bitcoin ecosystem by providing smart contracts and greater scalability.'
},
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
// If you use VSCode you can also use the GraphQL plugin
// Learn more at: https://gatsby.dev/graphql-typegen
graphqlTypegen: true,
plugins: [
`gatsby-transformer-json`,
`gatsby-plugin-netlify`,
//`gatsby-plugin-no-index`,
'gatsby-plugin-robots-txt',
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://dev.rootstock.io',
sitemap: 'https://dev.rootstock.io/sitemap.xml',
policy: [
{userAgent: '*', allow: '/', disallow: '/rif/identity'},
{ userAgent: '*', disallow: '/rif/scheduler'},
{ userAgent: '*', disallow: '/rif/marketplace'},
{ userAgent: '*', disallow: '/wallet/'},
{ userAgent: '*', disallow: '/tutorials/'},
{ userAgent: '*', disallow: '/libraries/'},
{ userAgent: '*', disallow: '/community-calls/'},
]
}
},
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl: `https://dev.rootstock.io`,
},
},
{
// gatsby-plugin-sitemap version is 3.0.0 because of https://stackoverflow.com/questions/69452298/problem-with-sitemap-generation-in-gatsby-js
resolve: "gatsby-plugin-sitemap",
options: {
exclude: [
"/tutorials/deploy-smart-contracts/",
"/rif/identity/*",
"/rif/scheduler/*",
"/rif/marketplace/*",
"/rsk/architecture/turing-complete/",
"/tutorials/interface-registry/",
"/rsk/public-nodes/",
"/tutorials/interact-with-smart-contracts/",
"/defi/",
"/rsk/rbtc/conversion/networks/mainnet/",
"/discord/",
"/tutorials/send-tokens-through-metamask/",
"/rsk/node/configure/autominer/",
"/develop/apps/wallets/metamask/",
"/rsk/node/install/java/",
"/tutorials/compile-smart-contracts-go/",
"/kb/get-crypto-on-rsk/cryptocurrency-vs-token/",
"/tutorials/using-blockmason/",
"/tutorials/ethereum-devs/remix-and-metamask-with-rsk-testnet/",
"/develop/apps/wallets/",
"/tutorials/rsk-api/",
"/kb/get-crypto-on-rsk/powpeg-btc-rbtc/",
"/wallet/",
"/tutorials/",
"/libraries/",
"/community-calls/",
],
query: `{
site {
siteMetadata {
siteUrl
}
}
allSitePage {
edges {
node {
path
pageContext
}
}
}
}`,
resolveSiteUrl: () => siteUrl,
serialize: ({ site, allSitePage }: any) =>
allSitePage.edges.map((edge: any) => {
return {
url: site.siteMetadata.siteUrl + edge.node.path,
lastmod: (edge.node.pageContext.lastMod) ? edge.node.pageContext.lastMod.substring(0,10) : null
}
}),
}
},
`gatsby-plugin-git-lastmod`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: "Rootstock Developers Portal",
short_name: "Rootstock Devportal",
description: 'Rootstock is the first open source Smart Contract platform secured by the Bitcoin Network. Rootstock adds value and expand functionality to the Bitcoin ecosystem by providing smart contracts and greater scalability.',
start_url: "/",
background_color: "#000000",
theme_color: "#000000",
display: "browser",
icon: "static/favicon.png",
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `home`,
path: `${__dirname}/content/rsk-devportal/index.md`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `the-stack`,
path: `${__dirname}/content/rsk-devportal/the-stack`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `rsk`,
path: `${__dirname}/content/rsk-devportal/rsk`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `kb`,
path: `${__dirname}/content/rsk-devportal/kb`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `rif`,
path: `${__dirname}/content/rsk-devportal/rif`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `guides`,
path: `${__dirname}/content/rsk-devportal/guides`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `courses`,
path: `${__dirname}/content/rsk-devportal/courses`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `solutions`,
path: `${__dirname}/content/rsk-devportal/solutions`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `develop`,
path: `${__dirname}/content/rsk-devportal/develop`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `tools`,
path: `${__dirname}/content/rsk-devportal/tools`
},
},
// {
// resolve: `gatsby-source-filesystem`,
// options: {
// name: `community-calls`,
// path: `${__dirname}/content/rsk-devportal/community-calls`
// },
// },
{
resolve: `gatsby-source-filesystem`,
options: {
name: `contribute`,
path: `${__dirname}/content/rsk-devportal/contribute`
},
},
// not used in the navigation
{
resolve: `gatsby-source-filesystem`,
options: {
name: `quick-start`,
path: `${__dirname}/content/rsk-devportal/_quick-start`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `defi`,
path: `${__dirname}/content/rsk-devportal/defi`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `ethereum-dapp-to-rsk`,
path: `${__dirname}/content/rsk-devportal/ethereum-dapp-to-rsk`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `libraries`,
path: `${__dirname}/content/rsk-devportal/libraries`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `newsletter`,
path: `${__dirname}/content/rsk-devportal/newsletter`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `open-finance`,
path: `${__dirname}/content/rsk-devportal/open-finance`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `discord`,
path: `${__dirname}/content/rsk-devportal/discord`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `roadmap`,
path: `${__dirname}/content/rsk-devportal/roadmap`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `tutorials`,
path: `${__dirname}/content/rsk-devportal/tutorials`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `wallet`,
path: `${__dirname}/content/rsk-devportal/wallet`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `webinars`,
path: `${__dirname}/content/rsk-devportal/webinars`
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `webinars-json`,
path: `${__dirname}/content/rsk-devportal/_data/webinars.json`
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-autolink-headers`,
options: {
offsetY: `100`,
icon: `<svg aria-hidden="true" height="20" version="1.1" viewBox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>`,
className: `custom-class`,
maintainCase: true,
removeAccents: true,
isIconAfterHeader: true,
elements: [`h1`, `h4`],
},
},
{
resolve: `gatsby-remark-prismjs`,
options: {
// Class prefix for <pre> tags containing syntax highlighting;
// defaults to 'language-' (e.g. <pre class="language-js">).
// If your site loads Prism into the browser at runtime,
// (e.g. for use with libraries like react-live),
// you may use this to prevent Prism from re-processing syntax.
// This is an uncommon use-case though;
// If you're unsure, it's best to use the default value.
classPrefix: "language-",
// This is used to allow setting a language for inline code
// (i.e. single backticks) by creating a separator.
// This separator is a string and will do no white-space
// stripping.
// A suggested value for English speakers is the non-ascii
// character '›'.
inlineCodeMarker: null,
// This lets you set up language aliases. For example,
// setting this to '{ sh: "bash" }' will let you use
// the language "sh" which will highlight using the
// bash highlighter.
aliases: {},
// This toggles the display of line numbers globally alongside the code.
// To use it, add the following line in gatsby-browser.js
// right after importing the prism color scheme:
// require("prismjs/plugins/line-numbers/prism-line-numbers.css")
// Defaults to false.
// If you wish to only show line numbers on certain code blocks,
// leave false and use the {numberLines: true} syntax below
showLineNumbers: false,
// If setting this to true, the parser won't handle and highlight inline
// code used in markdown i.e. single backtick code like `this`.
noInlineHighlight: false,
// This adds a new language definition to Prism or extend an already
// existing language definition. More details on this option can be
// found under the header "Add new language definition or extend an
// existing language" below.
// languageExtensions: [
// {
// language: "superscript",
// extend: "javascript",
// definition: {
// superscript_types: /(SuperType)/,
// },
// insertBefore: {
// function: {
// superscript_keywords: /(superif|superelse)/,
// },
// },
// },
// ],
// Customize the prompt used in shell output
// Values below are default
// prompt: {
// user: "root",
// host: "localhost",
// global: false,
// },
// By default the HTML entities <>&'" are escaped.
// Add additional HTML escapes by providing a mapping
// of HTML entities and their escape value IE: { '}': '{' }
// escapeEntities: {},
},
},
],
},
},
{
resolve: 'gatsby-plugin-vercel',
options: {
debug: false,
},
},
{
resolve: 'gatsby-plugin-local-search',
options: {
name: 'pages',
// The following engines are supported: flexsearch, lunr
engine: 'flexsearch',
// Note: Only the flexsearch engine supports options.
engineOptions: 'speed',
query: `
{
allMarkdownRemark(filter: {frontmatter: {redirect: {eq: null}}}) {
nodes {
id
frontmatter {
title
}
rawMarkdownBody
fileAbsolutePath
}
}
allFile {
edges {
node {
absolutePath
dir
name
}
}
}
}
`,
ref: 'id',
index: ['title'],
store: ['id', 'title', 'pageSlug'],
normalizer: ({data}: any) =>
data.allMarkdownRemark.nodes.map((node: any) => {
const file = data.allFile.edges.find((n: any) => n.node.absolutePath === node.fileAbsolutePath);
const {dir, name} = file.node;
const dirStart = dir.split('content/rsk-devportal')[1];
const pageSlug = `${dirStart.startsWith('/_') ? dirStart.substring(2) : dirStart}/${name === 'index' ? '' : `${name}/`}`;
const slugs = pageSlug.split('/').filter(t => t);
return {
id: node.id,
title: pageSlug === '/' ? 'Home' : node.frontmatter.title ? node.frontmatter.title : slugs[slugs.length - 1],
body: node.rawMarkdownBody,
pageSlug
};
}),
},
},
`gatsby-plugin-sass`
]
};
export default config;