forked from cardano-foundation/cardano-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
628 lines (603 loc) · 23.1 KB
/
docusaurus.config.js
File metadata and controls
628 lines (603 loc) · 23.1 KB
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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
// @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';
// Dotenv is a zero-dependency module that loads environment
// variables from a .env file into process.env
import 'dotenv/config';
// GitHub Settings to setup repository and branch customFields
const vars = require('./variables')
const { createSitemapItemsHook } = require('./scripts/sitemap-hreflang');
// enable or disable the announcement header bar (see 'announcementBar' section below)
const isAnnouncementActive = false;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Cardano',
tagline: 'Making The World Work Better For All',
// Set the production url of your site here
url: 'https://cardano.org',
// 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: 'cardano-foundation',
projectName: 'www-cardano-org',
trailingSlash: true,
onBrokenLinks: 'throw',
// Set to 'ignore' because anchor IDs are added dynamically by React components (e.g., Divider)
// Docusaurus can't detect these at build time
onBrokenAnchors: 'ignore',
markdown: {
format: 'mdx',
mermaid: false,
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},
customFields: {
repository: `${vars.repository}`,
branch: `${vars.branch}`,
//
// If you use the data.cardano.org endpoint and you want to run this locally you need to disable CORS
// Alternatively you can also replace it with a Koios endpoint and an Koios API Key.
CARDANO_ORG_API_URL: 'https://data.cardano.org/k/api/v1',
CARDANO_ORG_API_KEY: 'secret',
},
// 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', 'ja', 'de', 'es', 'vi'],
localeConfigs: {
en: { label: 'English', htmlLang: 'en-US' },
ja: { label: '日本語', htmlLang: 'ja' },
de: { label: 'Deutsch', htmlLang: 'de' },
es: { label: 'Español', htmlLang: 'es' },
vi: { label: 'Tiếng Việt', htmlLang: 'vi' },
},
},
headTags: [
{
tagName: 'meta',
attributes: {
name: 'algolia-site-verification',
content: '1E8DDBC2D1ADF529',
},
},
{
// Stub gtag for dev mode to prevent "window.gtag is not a function" errors
tagName: 'script',
attributes: {},
innerHTML: 'window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}',
},
{
tagName: 'link',
attributes: {
rel: 'icon',
href: '/img/favicon.ico',
media: '(prefers-color-scheme: light)',
},
},
{
tagName: 'link',
attributes: {
rel: 'icon',
href: '/img/favicon-light.ico',
media: '(prefers-color-scheme: dark)',
},
},
// Preload the two Chivo variable fonts so the browser fetches them in
// parallel with the HTML/CSS instead of waiting for the CSS to declare
// them. Paths point to /fonts/* which are served from static/ unhashed,
// matching the @font-face URLs declared inline below.
{
tagName: 'link',
attributes: {
rel: 'preload',
as: 'font',
type: 'font/ttf',
href: '/fonts/Chivo-VariableFont_wght.ttf',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'preload',
as: 'font',
type: 'font/ttf',
href: '/fonts/Chivo-Italic-VariableFont_wght.ttf',
crossorigin: 'anonymous',
},
},
// Inline @font-face so the URLs stay as /fonts/* (webpack does not see
// them) and the preload above hits the same cache entry.
{
tagName: 'style',
attributes: {},
innerHTML: `
@font-face {
font-family: 'Chivo';
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url('/fonts/Chivo-VariableFont_wght.ttf') format('truetype-variations');
}
@font-face {
font-family: 'Chivo';
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url('/fonts/Chivo-Italic-VariableFont_wght.ttf') format('truetype-variations');
}
`,
},
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: './sidebars.js',
editUrl: `${vars.repository}/edit/${vars.branch}`,
},
blog: {
showReadingTime: false,
routeBasePath: 'news',
blogSidebarCount: 50,
editUrl: `${vars.repository}/edit/${vars.branch}`,
onUntruncatedBlogPosts: 'ignore',
// Replaces the default "Blog | Cardano" page title and missing
// description on /news/. Translatable via Crowdin.
blogTitle: 'Cardano News',
blogDescription: 'Stay current with Cardano: weekly development reports, community digests, governance updates, and ecosystem announcements.',
},
theme: {
customCss: './src/css/custom.css',
},
gtag: {
// don't be evil
trackingID: 'G-LGRGXBVYMC',
anonymizeIP: true,
},
sitemap: {
lastmod: 'date',
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['**/tags/**', '**/news/tags/**', '**/news/page/**'],
// Hook implementation lives in scripts/sitemap-hreflang.js so it can be
// unit-tested without spinning up a Docusaurus build. See the JSDoc there.
createSitemapItems: createSitemapItemsHook({ projectRoot: __dirname }),
},
}),
],
],
plugins: [
[
'@docusaurus/plugin-ideal-image',
{
quality: 70,
max: 1030, // max resized image's size.
min: 640, // min resized image's size. if original is lower, use that size.
steps: 2, // the max number of images generated between min and max (inclusive)
},
],
function (context, options) {
return {
name: 'custom-webpack-config',
configureWebpack(config, isServer) {
return {
resolve: {
fallback: isServer ? {} : {
process: require.resolve('process/browser.js'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
},
fullySpecified: false,
},
plugins: isServer ? [] : [
new (require('webpack')).ProvidePlugin({
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer'],
}),
],
node: {
__dirname: true,
},
};
},
};
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// The project's social card
image: 'img/og/default.jpg',
// Toggle display of icons in the mega menu. Icons need to be added to /static/img/icons/ as svg files
megaMenuIcons: false,
// Toggle display of icons in mega menu column titles.
megaMenuColumnIcons: true,
// Algolia Search
algolia: {
appId: '2GOYNZM2J1',
apiKey: 'b3ea5bee26e2b95a6c6446489bdc6adf',
indexName: 'staging_pages',
contextualSearch: true,
searchPagePath: 'search',
// Search UI translations moved to i18n/*/docusaurus-theme-classic/theme.json
},
navbar: {
logo: {
alt: "Cardano Logo",
src: "img/cardano-logo-blue.svg",
srcDark: "img/cardano-logo-white.svg",
},
items: [
{
// The collapsed mega menu for "Learn"
label: 'Learn',
type: 'dropdown',
position: 'left',
items: [
{ to: '/what-is-ada', label: 'What is ada?' },
{ to: '/get-started', label: 'Get started with Cardano' },
{ to: '/wallets', label: 'Find a Wallet' },
{ to: '/where-to-get-ada', label: 'Where to get ada?' },
{ to: '/common-scams', label: 'Protect your ada' },
{ to: '/stake-pool-delegation', label: 'Delegate your ada' },
{ to: '/apps', label: 'Use Cardano Apps' },
{ to: '/research', label: 'Cardano Research' },
{ href: '/insights', label: 'Cardano Insights' },
{ to: '/hardforks', label: 'Hard Forks' },
],
// The mega menu full version for "Learn"
mega: true,
customProps: {
columns: [
{
title: 'Get to know',
icon: 'book-solid',
items: [
{ to: '/what-is-ada', label: 'What is ada?', description: 'Cardano\'s native token', icon: 'ada' },
{ to: '/get-started', label: 'Get started with Cardano', description: 'Learn the basics and start using Cardano', icon: 'wallet-solid' },
{ to: '/where-to-get-ada', label: 'Where to get ada?', description: 'Obtain ada to use Cardano', icon: 'coins-solid' },
{ to: '/common-scams', label: 'Protect your ada', description: 'Don\'t fall for scams', icon: 'shield-solid' },
],
},
{
title: 'Take part',
icon: 'shapes-solid',
items: [
{ to: '/wallets', label: 'Find a Wallet', description: 'Find the right wallet for you', icon: 'wallet-solid' },
{ to: '/stake-pool-delegation', label: 'Delegate your ada', description: 'Be a part of it and earn rewards', icon: 'handshake-solid' },
{ to: '/apps', label: 'Use Cardano Apps', description: 'Explore curated applications', icon: 'shapes-solid' },
{ to: '/community-code-of-conduct', label: 'Code of Conduct', description: 'Community standards and values', icon: 'heart-solid' },
],
},
{
title: 'Research',
icon: 'flask-vial-solid',
items: [
{ to: '/research', label: 'Cardano Research', description: 'Peer-reviewed research and papers', icon: 'flask-vial-solid' },
{ href: '/insights', label: 'Cardano Insights', description: 'On‑chain or regularly refreshed data', icon: 'chart-line-solid' },
{ to: '/hardforks', label: 'Hard Forks', description: 'Implemented Upgrades', icon: 'code-branch-solid' },
],
},
],
},
},
{
// The collapsed mega menu for "Participate"
label: 'Participate',
type: 'dropdown',
position: 'left',
items: [
{ to: '/news', label: 'News' },
{ to: '/newsletter', label: 'Newsletter' },
{ to: '/docs/communities/', label: 'Online Communities' },
{ to: '/ambassadors', label: 'Cardano Ambassadors' },
{ to: '/events', label: 'Cardano Events' },
{ href: 'https://forum.cardano.org', label: 'Cardano Forum' },
{ to: '/docs/get-involved', label: 'Get involved in cardano.org' },
{ to: '/governance', label: 'Governance Overview' },
{ to: '/governance/delegate', label: 'Delegate your vote' },
{ to: '/governance#lead', label: 'Become a DRep' },
{ to: '/governance#tools', label: 'Governance Tools' },
{ to: '/constitution', label: 'Cardano Constitution' },
],
// The mega menu full version for "Participate"
mega: true,
customProps: {
columns: [
{
title: 'Connect',
icon: 'link-solid',
items: [
{ to: '/news', label: 'News', description: 'Latest Cardano news and updates', icon: 'newspaper-solid' },
{ to: '/newsletter', label: 'Newsletter', description: 'Stay updated with Cardano news', icon: 'envelope-solid' },
{ to: '/docs/communities/', label: 'Online Communities', description: 'Recommended Channels', icon: 'share-nodes-solid' },
{ to: '/ambassadors', label: 'Ambassador Program', description: 'Meet Cardano Ambassadors', icon: 'people-group-solid' },
],
},
{
title: 'Engage',
icon: 'comments-solid',
items: [
{ to: '/events', label: 'Cardano Events', description: 'Join Cardano community events', icon: 'calendar-solid' },
{ href: 'https://forum.cardano.org', label: 'Cardano Forum', description: 'Structured long-format discussions', icon: 'comments-solid' },
{ to: '/docs/get-involved', label: 'Get involved in cardano.org', description: 'If you’d like to participate, this will get you started', icon: 'shapes-solid' },
],
},
{
title: 'Governance',
icon: 'users-solid',
items: [
{ to: '/governance', label: 'Governance Overview', description: 'How Cardano governance works', icon: 'scroll-solid' },
{ to: '/governance/delegate', label: 'Delegate your vote', description: 'Lend your voting power to a DRep', icon: 'scroll-solid' },
{ to: '/governance#lead', label: 'Become a DRep', description: 'Represent your community', icon: 'scroll-solid' },
{ to: '/governance#tools', label: 'Governance Tools', description: 'Tools for governance participation', icon: 'scroll-solid' },
],
},
],
},
},
/*
{
label: 'Insights',
position: 'left',
items: [
{to: '/insights/demo/', label: 'Simple Demo'},
{to: '/insights/supply/', label: 'Supply'},
],
},*/
{
// The collapsed mega menu for "Build"
label: 'Build',
type: 'dropdown',
position: 'left',
items: [
{ to: '/developers', label: 'Start building on Cardano' },
{ to: '/exchanges', label: 'Integrate Cardano' },
{ href: 'https://developers.cardano.org', label: 'Developer Portal' },
{ href: 'https://developers.cardano.org/tools', label: 'Builder Tools' },
{ to: '/entities/', label: 'Companies building on Cardano' },
],
// The mega menu full version for "Build"
mega: true,
customProps: {
columnCount: 2,
columns: [
{
title: 'Get started',
icon: 'code-solid',
items: [
{ to: '/developers', label: 'Start building on Cardano', description: 'Developer resources and tooling', icon: 'code-solid' },
{ to: '/exchanges', label: 'Integrate Cardano', description: 'Exchange and integration guides', icon: 'plug-solid' },
],
},
{
title: 'Tools',
icon: 'wrench-solid',
items: [
{ href: 'https://developers.cardano.org', label: 'Developer Portal', description: 'Cardano developer portal and docs', icon: 'book-solid' },
{ href: 'https://developers.cardano.org/tools', label: 'Builder Tools', description: 'Tools to build on Cardano', icon: 'wrench-solid' },
{ to: '/entities/#companies', label: 'Companies building on Cardano', description: 'Companies, associations, and collaborations', icon: 'building-solid' },
],
},
],
},
},
{
// The collapsed mega menu for "Solutions"
label: 'Solutions',
type: 'dropdown',
position: 'left',
items: [
{ to: '/solutions', label: 'Enterprise Solutions' },
{ to: '/use-cases', label: 'Use Cases' },
{ to: '/use-cases#identity', label: 'Identity' },
{ to: '/use-cases#finance', label: 'Finance' },
{ to: '/use-cases#supply-chain', label: 'Supply Chain' },
],
// The mega menu full version for "Solutions"
mega: true,
customProps: {
columnCount: 2,
columns: [
{
title: 'For Enterprise',
icon: 'building-solid',
items: [
{ to: '/solutions', label: 'Enterprise Solutions', description: 'Case studies and proven deployments', icon: 'building-solid' },
{ href: 'https://cardanofoundation.org/contact', label: 'Contact the Foundation', description: 'Partner with the Cardano Foundation', icon: 'envelope-solid' },
],
},
{
title: 'Use Cases',
icon: 'shapes-solid',
items: [
{ to: '/use-cases', label: 'All Use Cases', description: 'Explore blockchain applications', icon: 'shapes-solid' },
{ to: '/use-cases#identity', label: 'Identity', description: 'Credentials & verification', icon: 'users-solid' },
{ to: '/use-cases#supply-chain', label: 'Supply Chain', description: 'Traceability & provenance', icon: 'route-solid' },
],
},
],
},
},
/* we may want to hide this, and link it only via localhost link in the read me */
/*
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Tutorial',
},
*/
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
type: 'html',
value: '<hr style="margin: 4px 0;">',
},
{
to: '/translations',
label: 'Help Translate',
},
],
},
],
},
footer: {
style: 'dark',
links: [
/* we may want to hide this, and link it only via localhost link in the read me */
/*
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
*/
{
title: 'Entities',
items: [
{
label: 'Cardano Foundation',
to: '/entities?tab=cardanofoundation',
},
{
label: 'EMURGO',
to: '/entities?tab=emurgo',
},
{
label: 'Input Output',
href: '/entities?tab=iog',
},
{
label: 'Intersect',
href: '/entities?tab=intersect',
},
{
label: 'PRAGMA',
href: '/entities?tab=pragma',
},
{
label: 'More entities',
href: '/entities/',
},
],
},
{
title: 'Support',
items: [
{
label: 'Brand Assets',
to: '/brand-assets',
},
{
label: 'Glossary',
to: '/docs/glossary#cardano-glossary',
},
{
label: 'Discord',
to: '/docs/communities/#cardano-on-discord',
},
{
label: 'Newsletter',
to: '/newsletter',
},
{
label: 'Contact',
to: '/contact',
},
],
},
{
title: 'Legal',
items: [
{
label: 'Terms',
href: 'https://cardanofoundation.org/en/terms-and-conditions',
},
{
label: 'Privacy Policy',
href: 'https://cardanofoundation.org/en/privacy',
},
/* TODO: once we have these files, link locally not to the cf page
{
label: 'Terms',
to: '/terms-and-conditions',
},
{
label: 'Privacy Policy',
to: '/privacy-policy',
},
{
label: 'Cookie Policy',
to: '/cookie-policy',
},
*/
],
},
{
title: 'More',
items: [
{
label: 'Cardano News',
to: '/news',
},
{
label: 'Get Involved',
to: '/docs/get-involved',
},
{
label: 'Contributors',
href: 'https://github.com/cardano-foundation/cardano-org/graphs/contributors',
},
{
label: 'GitHub',
href: 'https://github.com/cardano-foundation/cardano-org',
}
],
},
],
copyright: `® Cardano`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
// Announcement Bar
// id: always change it when changing the announcement
// backgroundColor: use #1442B3 for announcements
announcementBar: isAnnouncementActive ? {
id: "announcement_index5", // Any value that will identify this message + increment the number every time to be unique
content:
`<strong>Cardano Summit 2025 Berlin</strong> 🎟️ Secure your pass now ➡️ <strong><a href="https://summit.cardano.org/page/5056323/tickets#section-6268783" style="color:white; font-weight:bold; text-decoration:underline;">Visit the ticket shop</a></strong>`,
backgroundColor: "#1442B3",
textColor: "#FFFFFF", // Use #FFFFFF
isCloseable: true, // Use true
} : undefined,
}),
// Custom JavaScript that will be injected into the <head> section of every page
scripts: [
{
src: '/scripts/deactivateServiceWorker.js',
async: true
}
],
};
export default config;