forked from ton-community/ton-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docusaurus.config.js
536 lines (513 loc) · 16.2 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
require("dotenv").config();
const getEnvLangConfig = () => {
const defaultLocale = process.env.DEFAULT_LOCALE || "en";
const langArray = process.env.TARGET_LANGS
? process.env.TARGET_LANGS.split(",")
: ["mandarin"];
// : ["mandarin", "ru", "ko", "pl", "uk", "ja"];
const locales = Array.from(new Set([defaultLocale, ...langArray]));
return {
defaultLocale,
locales,
localeConfigs: {
en: {
label: "English",
},
'mandarin': {
label: '简体中文',
path: "zh-CN",
},
},
};
};
// function to get current year
function getCurrentYear () {
const now = new Date()
return now.getFullYear()
}
// show current year in text
const currentYear = getCurrentYear()
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'The Open Network',
tagline: 'Mass adoption. Massive distribution',
url: 'https://docs.ton.org',
staticDirectories: ['public', 'static'],
baseUrl: '/',
themes: [
'@docusaurus/theme-live-codeblock',
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
indexPages: true,
indexBlog: false,
searchBarShortcutHint: false,
// For Docs using Chinese, The `language` is recommended to set to:
// ```
language: ["en", "zh"],
// ```
},
],
],
plugins: [
['docusaurus-plugin-sass', {}],
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
// CamelCase to kebab-case
{
to: '/learn/tvm-instructions/tvm-exit-codes',
from: '/learn/tvm-instructions/tvm_exit_codes',
},
{
to: '/develop/dapps/telegram-apps',
from: '/develop/dapps/twa',
},
{
to: '/learn/tvm-instructions/tvm-overview',
from: '/learn/tvm-instructions/tvm_overview',
},
{
to: '/learn/overviews/ton-blockchain',
from: '/learn/overviews/TON_Blockchain_overview',
},
{
to: '/learn/networking/low-level-adnl',
from: '/learn/overviews/adnl',
},
{
to: '/develop/dapps/tutorials/accept-payments-in-a-telegram-bot',
from: '/develop/dapps/payment-processing/accept-payments-in-a-telegram-bot',
},
{
to: '/develop/dapps/tutorials/accept-payments-in-a-telegram-bot-2',
from: '/develop/dapps/payment-processing/accept-payments-in-a-telegram-bot-2',
},
{
to: '/develop/get-started-with-ton',
from: '/develop/onboarding-challenge',
},
{
to: '/develop/overview',
from: '/develop/getting-started',
},
{
to: '/develop/data-formats/tl-b-language',
from: '/develop/data-formats/tl-b',
},
{
to: '/learn/tvm-instructions/tvm-upgrade-2023-07',
from: '/learn/tvm-instructions/tvm-upgrade',
},
{
to: '/develop/smart-contracts/testing/overview',
from: '/develop/smart-contracts/testing/tonstarter',
}
],
},
],
],
stylesheets: [
'https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Inter:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap',
],
onBrokenLinks: 'warn', // for PRODUCTION
onBrokenMarkdownLinks: 'warn', //for PRODUCTION
// onBrokenLinks: 'throw',
// onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon32x32.png',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'ton', // Usually your GitHub org/user name.
projectName: 'ton-docs', // Usually your repo name.
// Even if you don't use internalization, 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: getEnvLangConfig(),
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
gtag: {
trackingID: 'G-0PVST6PCG8',
anonymizeIP: true,
},
docs: {
routeBasePath: '/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/ton-community/ton-docs/tree/main/',
// lastVersion: '1.0.0',
// versions: {
// current: {
// path: 'next',
// banner: 'none',
// badge: false,
// },
// '1.0.0': {
// path: '/',
// banner: 'none',
// badge: false,
// }
// }
remarkPlugins: [
[require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
],
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/ton-community/ton-docs/tree/main/',
},
theme:
{
customCss: require.resolve('./src/css/custom.css'),
},
pages: {
mdxPageComponent: '@site/src/components/MDXPage'
}
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: {
// The application ID provided by Algolia
appId: 'AIQ3FM6W39',
// Public API key: it is safe to commit it
apiKey: 'ab02d1c08f877a738f59233af7f5ed6b',
indexName: 'ton',
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
// externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
//... other Algolia params
},
// announcementBar: {
// // id: 'contribute/hacktoberfest',
// content: '<a rel="noopener noreferrer" target="_blank" href="https://society.ton.org/hack-ton-berfest-2023?utm_source=tondocs&utm_medium=top_banner&utm_campaign=promo"><span>The <b>HACK-TON-BERFEST 2023</b> event is near! Double-merch, NFT rewards and more!</span> <span class="mobile-view">Double-merch, NFT reward and more!</span></a>',
// textColor: '#F3F3F7',
// isCloseable: false,
// },
image: 'img/snippet.png',
navbar: {
title: '',
logo: {
alt: 'TON',
src: 'img/ton_logo_light_background.svg',
srcDark: 'img/ton_logo_dark_background.svg',
},
items: [
{
type: 'dropdown',
to: '/learn/introduction',
position: 'left',
label: 'Concepts',
items: [
{
to: '/learn/introduction',
label: 'Introduction to TON',
},
{
to: '/learn/overviews/ton-blockchain',
label: 'Blockchain of Blockchains',
},
{
to: '/learn/overviews/addresses',
label: 'Smart Contract Addresses',
},
{
to: '/learn/overviews/cells',
label: 'Cells as a Data Structure',
},
{
to: '/learn/networking/overview',
label: 'TON Networking',
},
{
to: '/learn/docs',
label: 'Whitepapers',
},
],
},
{
type: 'dropdown',
to: '/develop/overview',
position: 'left',
label: 'Get Started',
items: [
{
to: '/develop/overview',
label: 'Start with Onboarding Tutorials',
},
{
to: '/develop/dapps/tutorials/jetton-minter',
label: 'Mint your Tokens',
},
{
to: '/develop/dapps/tutorials/collection-minting',
label: 'Mint your NFTs',
},
{
to: '/develop/dapps/telegram-apps/',
label: 'Build your first Mini App',
},
{
to: '/develop/dapps',
label: 'Dive into DApps Development',
},
],
},
{
type: 'dropdown',
to: 'develop/dapps',
position: 'left',
label: 'DApps',
items: [
{
to: 'develop/dapps/apis/sdk',
label: 'APIs and SDKs',
},
{
to: 'develop/dapps/asset-processing',
label: 'Asset Processing',
},
{
to: 'develop/dapps/asset-processing/jettons',
label: 'Jetton Processing',
},
{
to: '/develop/dapps/cookbook',
label: 'Cookbook',
},
{
to: '/develop/dapps/telegram-apps/',
label: 'TMA Development',
},
],
},
{
type: 'dropdown',
to: 'develop/overview',
position: 'left',
label: 'Smart Contracts',
items: [
{
to: '/develop/smart-contracts/tutorials/wallet',
label: 'Understanding Wallets',
},
{
to: 'develop/smart-contracts',
label: 'Write Smart Contracts',
},
{
to: '/develop/smart-contracts/messages',
label: 'Sending Messages',
},
{
to: 'develop/smart-contracts/fees',
label: 'Transaction Fees',
},
{
to: 'develop/smart-contracts/guidelines',
label: 'Best Practices for Contracts',
},
{
to: 'develop/func/overview',
label: 'FunC Development Language',
},
{
to: 'develop/func/cookbook',
label: 'FunC Cookbook',
},
{
to: '/develop/data-formats/cell-boc',
label: 'Data formats',
},
{
to: 'learn/tvm-instructions/tvm-overview',
label: 'TON Virtual Machine (TVM)',
},
],
},
{
type: 'dropdown',
to: 'participate',
position: 'left',
label: 'Nodes',
items: [
{
to: '/participate/run-nodes/mytonctrl',
label: 'MyTonCtrl',
},
{
to: '/participate/nodes/node-types',
label: 'Node Types',
},
{
to: '/participate/run-nodes/full-node',
label: 'Full Node',
},
{
to: '/participate/run-nodes/enable-liteserver-node',
label: 'Liteserver Node',
},
{
to: '/participate/run-nodes/become-validator',
label: 'Validator Node',
},
{
to: '/participate/run-nodes/archive-node',
label: 'Archive Node',
},
{
to: '/participate/run-nodes/nodes-troubleshooting',
label: 'Troubleshooting the Node',
},
{
to: '/participate/network-maintenance/single-nominator',
label: 'Single Nominator Pool',
},
{
to: '/participate/network-maintenance/nominator-pool',
label: 'Nominator Pool',
},
{
to: '/participate/network-maintenance/vesting-contract',
label: 'Vesting Contract',
},
{
to: '/participate/run-nodes/mytonctrl-status',
label: 'MyTonCtrl Status',
},
{
to: '/participate/run-nodes/faq',
label: 'FAQ',
},
],
},
{
type: 'dropdown',
to: 'participate',
position: 'left',
label: 'Web3',
items: [
{
to: 'participate/web3/dns',
label: 'TON DNS & Domains',
},
{
to: 'participate/web3/how-to-open-any-ton-site',
label: 'Open TON Sites',
},
{
to: 'develop/dapps/tutorials/how-to-run-ton-site',
label: 'Run TON Sites',
},
{
to: 'participate/ton-storage/storage-daemon',
label: 'Run a Storage Daemon',
},
{
to: 'participate/ton-storage/storage-provider',
label: 'Build a Storage Provider',
},
],
},
{
type: 'dropdown',
label: 'Community',
position: 'left',
items: [
{
to: 'https://tonresear.ch/',
label: 'TON Research',
},
{
to: 'https://t.me/addlist/1r5Vcb8eljk5Yzcy',
label: 'TON Developers Kit',
},
{
to: 'https://t.me/tonsupport_aibot',
label: 'AI TON Support Agent',
},
{
to: 'https://github.com/ton-blockchain/TEPs',
label: 'Standards Discussion (TEPs)',
},
{
to: 'contribute',
label: 'Contribute to Docs',
},
],
},
{
href: 'https://github.com/ton-community/ton-docs',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
type: 'html',
value: '<hr style="margin: 0.3rem 0;">',
},
{
href: "/contribute/localization-program/overview",
label: 'Help Us Translate',
},
],
},
],
},
footer: {
// style: 'dark',
// copyright: `Copyright © ${new Date().getFullYear()} TON Foundation`,
},
prism: {
theme: require('./prism-theme'),
darkTheme: require('./prism-theme'),
additionalLanguages: [
'java',
'python',
'kotlin',
'go',
'typescript',
'cpp',
'c',
],
},
docs: {
sidebar: {
hideable: false,
},
},
colorMode: {
defaultMode: 'light',
// respectPrefersColorScheme: true,
// disableSwitch: true,
},
}),
}
module.exports = config