-
Notifications
You must be signed in to change notification settings - Fork 146
/
docusaurus.config.js
557 lines (542 loc) · 17.1 KB
/
docusaurus.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
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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config
import { themes as prismThemes } from "prism-react-renderer";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "MultiversX Docs",
titleDelimiter: "•",
tagline:
"A highly scalable, fast and secure blockchain platform for distributed apps, enterprise use cases and the new internet economy.",
favicon: "img/favicons/favicon.ico",
// Set the production url of your site here
url: "https://docs.multiversx.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "multiversx", // Usually your GitHub org/user name.
projectName: "mx-docs", // Usually your repo name.
onBrokenLinks: "log",
onBrokenMarkdownLinks: "log",
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
// mermaid support
markdown: {
mermaid: true,
},
themes: ["@docusaurus/theme-mermaid"],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css",
type: "text/css",
integrity:
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
crossorigin: "anonymous",
},
{
href: "https://fonts.googleapis.com/css?family=Montserrat:400,500,600&display=swap",
type: "text/css",
crossorigin: "anonymous",
},
],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/", // Serve the docs at the site's root
sidebarPath: "./sidebars.js",
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
showLastUpdateTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/multiversx/mx-docs/edit/development",
},
blog: false,
theme: {
customCss: "./src/css/custom.css",
},
gtag: {
trackingID: "G-TW3LCJ0LS7",
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: "dark",
disableSwitch: false,
respectPrefersColorScheme: false,
},
// Replace with your project's social card
image: "img/social.jpg",
metadata: [
{ name: "twitter:site", content: "@MultiversX" },
{ name: "twitter:creator", content: "@MultiversX" },
{ name: "twitter:title", content: "MultiversX Docs" },
{
name: "twitter:description",
content:
"A highly scalable, fast and secure blockchain platform for distributed apps, enterprise use cases and the new internet economy.",
},
],
navbar: {
logo: {
alt: "MultiversX Docs",
src: "img/logo_dark.svg",
srcDark: "img/logo.svg",
},
items: [
{
href: "/developers/overview",
label: "Developers",
position: "left",
},
{
href: "/validators/overview",
label: "Validators",
position: "left",
},
{
href: "/integrators/overview",
label: "Integrate",
position: "left",
},
{
href: "/learn/architecture-overview",
label: "Learn",
position: "left",
},
{
href: "https://github.com/multiversx",
label: "GitHub",
position: "right",
className: "header-github-link",
"aria-label": "GitHub",
},
{
href: "https://discord.gg/multiversxbuilders",
label: "Discord",
position: "right",
className: "header-discord-link",
"aria-label": "Discord",
},
{
href: "https://t.me/MultiversX",
label: "Telegram",
position: "right",
className: "header-telegram-link",
"aria-label": "Chat",
},
{
type: "dropdown",
label: "Websites",
position: "right",
className: "header-app-change",
"aria-label": "Websites",
items: [
{
label: "Main Site",
href: "https://multiversx.com",
target: "_blank",
},
{
label: "Wallet",
href: "https://wallet.multiversx.com",
target: "_blank",
},
{
label: "Explorer",
href: "https://explorer.multiversx.com",
target: "_blank",
},
{
label: "Bridge",
href: "https://bridge.multiversx.com",
target: "_blank",
},
{
label: "xExchange",
href: "https://xexchange.com",
target: "_blank",
},
{
label: "xLaunchpad",
href: "https://xlaunchpad.com",
target: "_blank",
},
],
},
],
},
footer: {
style: "light",
links: [],
copyright: `Copyright © ${new Date().getFullYear()} MultiversX. All rights reserved.`,
},
prism: {
theme: prismThemes.vsLight,
darkTheme: prismThemes.vsDark,
additionalLanguages: [
"rust",
"tsx",
"toml",
"bash",
"diff",
"json",
"solidity",
"yaml",
],
},
algolia: {
// The application ID provided by Algolia
appId: `${process.env.REACT_APP_ALGOLIA_APP_ID}`,
// Public API key: it is safe to commit it
apiKey: `${process.env.REACT_APP_ALGOLIA_SEARCH_KEY}`,
indexName: "elrond",
contextualSearch: false,
},
slugPreprocessor: (slugBase) =>
slugBase.replace(/<([^>]+?)([^>]*?)>(.*?)<\/\1>/gi, ""),
}),
headTags: [
{
tagName: "link",
attributes: {
rel: "preconnect",
href: "https://cdn.multiversx.com",
},
},
],
plugins: [
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/technology/glossary",
to: "/welcome/terminology",
},
{
from: "/technology/architecture-overview",
to: "/learn/architecture-overview",
},
{
from: "/technology/secure-proof-of-stake",
to: "/learn/consensus",
},
{
from: "/technology/chronology",
to: "/learn/chronology",
},
{
from: "/technology/entities",
to: "/learn/entities",
},
{
from: "/technology/adaptive-state-sharding",
to: "/learn/sharding",
},
{
from: "/technology/cross-shard-transactions",
to: "/learn/transactions",
},
{
from: "/economics",
to: "/learn/economics",
},
{
from: "/tokens/esdt-tokens",
to: "/tokens/fungible-tokens",
},
{
from: "/tokens/overview",
to: "/tokens/intro",
},
{
from: "/validators/staking/convert-existing-validator-into-staking-pool",
to: "/validators/staking/convert-existing-validator-into-staking-provider",
},
{
from: "/sdk-and-tools/rest-api/api-com/",
to: "/sdk-and-tools/rest-api/multiversx-api/",
},
{
from: "/validators/elrond-go-scripts/config-scripts",
to: "/validators/nodes-scripts/config-scripts",
},
{
from: "/validators/elrond-go-scripts/install-update",
to: "/validators/nodes-scripts/install-update",
},
{
from: "/sdk-and-tools/dapp-core",
to: "/sdk-and-tools/sdk-dapp",
},
{
from: "/validators/staking-providers-apr",
to: "/economics/staking-providers-apr",
},
{
from: "/sdk-and-tools/rest-api/rest-api",
to: "/sdk-and-tools/rest-api",
},
{
from: "/developers/developer-reference/wasm-annotations",
to: "/developers/developer-reference/sc-annotations",
},
{
from: "/developers/developer-reference/sc-contract-calls",
to: "/developers/transactions/tx-legacy-calls",
},
{
from: "/developers/developer-reference/wasm-modules",
to: "/developers/developer-reference/sc-modules",
},
{
from: "/developers/developer-reference/wasm-contract-calls",
to: "/developers/transactions/tx-legacy-calls",
},
{
from: "/developers/developer-reference/wasm-api-functions",
to: "/developers/developer-reference/sc-api-functions",
},
{
from: "/developers/developer-reference/rust-smart-contract-debugging",
to: "/developers/testing/sc-debugging",
},
{
from: "/developers/developer-reference/sc-debugging",
to: "/developers/testing/sc-debugging",
},
{
from: "/developers/developer-reference/rust-testing-framework",
to: "/developers/testing/rust/whitebox-legacy",
},
{
from: "/developers/developer-reference/rust-testing-framework-functions-reference",
to: "/developers/testing/rust/whitebox-legacy-functions-reference",
},
{
from: "/developers/developer-reference/smart-contract-build-reference",
to: "/developers/meta/sc-build-reference",
},
{
from: "/developers/developer-reference/sc-build-reference",
to: "/developers/meta/sc-build-reference",
},
{
from: "/developers/developer-reference/serialization-format",
to: "/developers/data/serialization-overview",
},
{
from: "/developers/developer-reference/random-numbers-in-smart-contracts",
to: "/developers/developer-reference/sc-random-numbers",
},
{
from: "/developers/developer-reference/sc-meta",
to: "/developers/meta/sc-meta",
},
{
from: "/developers/developer-reference/code-metadata",
to: "/developers/data/code-metadata",
},
{
from: "/developers/best-practices/multi-values",
to: "/developers/data/multi-values",
},
{
from: "/developers/scenario-reference/overview",
to: "/developers/testing/scenario/concept",
},
{
from: "/developers/scenario-reference/structure",
to: "/developers/testing/scenario/structure-json",
},
{
from: "/developers/scenario-reference/values-simple",
to: "/developers/testing/scenario/values-simple",
},
{
from: "/developers/scenario-reference/values-complex",
to: "/developers/testing/scenario/values-complex",
},
{
from: "/developers/scenario-reference/embed",
to: "/developers/testing/testing-in-go",
},
{
from: "/developers/mandos-reference/overview",
to: "/developers/testing/scenario/concept",
},
{
from: "/developers/mandos-reference/structure",
to: "/developers/testing/scenario/structure-json",
},
{
from: "/developers/mandos-reference/values-simple",
to: "/developers/testing/scenario/values-simple",
},
{
from: "/developers/mandos-reference/values-complex",
to: "/developers/testing/scenario/values-complex",
},
{
from: "/developers/mandos-reference/embed",
to: "/developers/testing/testing-in-go",
},
{
from: "/sdk-and-tools/erdjs",
to: "/sdk-and-tools/sdk-js",
},
{
from: "/sdk-and-tools/erdjava",
to: "/sdk-and-tools/mxjava",
},
{
from: "/sdk-and-tools/erdgo",
to: "/sdk-and-tools/sdk-go",
},
{
from: "/sdk-and-tools/erdjs/erdjs-cookbook",
to: "/sdk-and-tools/sdk-js/sdk-js-cookbook-versions",
},
{
from: "/sdk-and-tools/sdk-js/sdk-js-cookbook",
to: "/sdk-and-tools/sdk-js/sdk-js-cookbook-v13",
},
{
from: "/sdk-and-tools/erdjs/writing-and-testing-erdjs-interactions",
to: "/sdk-and-tools/sdk-js/writing-and-testing-sdk-js-interactions",
},
{
from: "/sdk-and-tools/erdjs/erdjs-migration-guides",
to: "/sdk-and-tools/sdk-js/sdk-js-migration-guides",
},
{
from: "/sdk-and-tools/erdjs/erdjs-signing-providers",
to: "/sdk-and-tools/sdk-js/sdk-js-signing-providers",
},
{
from: "/sdk-and-tools/sdk-py/configuring-mxpy",
to: "/sdk-and-tools/sdk-py/mxpy-cli",
},
{
from: "/sdk-and-tools/sdk-py/deriving-the-wallet-pem-file",
to: "/sdk-and-tools/sdk-py/mxpy-cli",
},
{
from: "/developers/log-events/esdt-events",
to: "/developers/event-logs/esdt-events",
},
{
from: "/developers/log-events/execution-events",
to: "/developers/event-logs/execution-events",
},
{
from: "/developers/log-events/contract-call-events",
to: "/developers/event-logs/contract-call-events",
},
{
from: "/developers/log-events/contract-deploy-events",
to: "/developers/event-logs/contract-deploy-events",
},
{
from: "/developers/log-events/system-delegation-events",
to: "/developers/event-logs/system-delegation-events",
},
],
createRedirects(existingPath) {
return undefined; // Return a falsy value: no redirect created
},
},
],
[
"pwa",
{
// debug: isDeployPreview,
offlineModeActivationStrategies: [
"appInstalled",
"standalone",
"queryString",
],
// swRegister: false,
// swCustom: require.resolve("./src/sw.js"), // TODO make it possible to use relative path
pwaHead: [
{
tagName: "link",
rel: "icon",
href: "img/favicons/apple-touch-icon.png",
},
{
tagName: "link",
rel: "manifest",
href: "manifest/manifest.json",
},
{
tagName: "meta",
name: "theme-color",
content: "rgb(14, 14, 14)",
},
{
tagName: "meta",
name: "apple-mobile-web-app-capable",
content: "yes",
},
{
tagName: "meta",
name: "apple-mobile-web-app-status-bar-style",
content: "#0e0e0e",
},
{
tagName: "link",
rel: "apple-touch-icon",
href: "img/favicons/apple-touch-icon.png",
},
{
tagName: "link",
rel: "mask-icon",
href: "img/favicons/apple-touch-icon.png",
color: "rgb(14, 14, 14)",
},
{
tagName: "meta",
name: "msapplication-TileImage",
content: "img/favicons/mstile-150x150.png",
},
{
tagName: "meta",
name: "msapplication-TileColor",
content: "#0e0e0e",
},
],
},
],
async function tailwindPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],
};
export default config;