-
Notifications
You must be signed in to change notification settings - Fork 302
/
docusaurus.config.js
351 lines (350 loc) · 9.47 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
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const path = require("path");
const math = require("remark-math");
const katex = require("rehype-katex");
const DefaultLocale = "en";
module.exports = {
title: "Celo Documentation",
tagline: "Documentation for the Celo platform.",
url: "https://docs.celo.org",
baseUrl: "/",
trailingSlash: false,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onBrokenAnchors: "throw",
favicon: "img/color-favicon.png",
organizationName: "celo-org", // Usually your GitHub org/user name.
projectName: "docs", // Usually your repo name.
i18n: {
defaultLocale: "en",
locales: ["en"],
},
themes: [
"@docusaurus/theme-live-codeblock",
"@saucelabs/theme-github-codeblock",
],
scripts: [
// {
// src: "https://cdnjs.cloudflare.com/ajax/libs/web3/1.6.0/web3.min.js",
// async: true,
// },
],
plugins: [
require.resolve("docusaurus-plugin-hubspot"),
require.resolve("docusaurus-plugin-fathom"),
path.resolve(__dirname, "src/plugins/aliases.ts"),
path.resolve(__dirname, "src/plugins/web3-polyfill.ts"),
// [
// "@docusaurus/plugin-client-redirects",
// {
// redirects: [],
// },
// ],
[
"@docusaurus/plugin-ideal-image",
{
quality: 70,
max: 1030,
min: 640,
steps: 2,
// Use false to debug, but it incurs huge perf costs
disableInDev: true,
},
],
async function myPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],
themeConfig: {
twitterImage: "img/preview.png",
image: "img/preview.png",
announcementBar: {
id: "request_tokens",
content:
'Alfajores L2 Testnet is live! Full node operators: <a target="_blank" rel="noopener noreferrer" href="/cel2">Upgrade your nodes</a> now.',
backgroundColor: "#18191A",
textColor: "#ffffff",
isCloseable: false,
},
docs: {
sidebar: { hideable: true },
},
prism: {
additionalLanguages: ["solidity", "bash", "diff"],
theme: require("prism-react-renderer").themes.dracula,
},
mermaid: { theme: "dark" },
colorMode: {
defaultMode: "dark",
respectPrefersColorScheme: false,
},
navbar: {
title: "Celo Docs",
logo: {
alt: "Celo Logo",
src: "img/logo.png",
srcDark: "img/logo-dark.png",
height: 32,
width: 96,
},
items: [
{
to: "/general",
label: "What is Celo",
position: "left",
},
{
to: "build/",
label: "Get Started",
position: "left",
},
{
to: "developer/",
label: "Build on Celo",
position: "left",
},
{
to: "cel2/",
label: "Celo L2",
position: "left",
},
{
type: "dropdown",
label: "More",
position: "left",
items: [
{
to: "protocol/",
label: "Protocol",
},
{
to: "validator/",
label: "Validators",
},
{
to: "holder/",
label: "Holder",
},
{
to: "cli/",
label: "CLI",
},
{ to: "https://www.celopg.eco/ecosystem", label: "dApps", target: "_blank" },
],
},
{
type: "localeDropdown",
position: "right",
dropdownItemsAfter: [
{
to: "https://celo.crowdin.com/",
label: "Help us translate",
},
],
},
{
type: "dropdown",
position: "right",
label: "Support",
items: [
{
to: "https://forum.celo.org/",
label: "View the Forum",
},
{
to: "https://github.com/celo-org/docs/issues/new",
label: "Leave Feedback",
},
],
},
// {
// type: "dropdown",
// position: "right",
// label: "Libraries & SDKs",
// items: [
// { to: "cli/", label: "CLI" },
// {
// to: "/developer/viem",
// label: "Viem",
// },
// {
// to: "/developer/react-celo",
// label: "React-Celo",
// },
// {
// to: "/developer/contractkit",
// label: "ContractKit",
// },
// {
// to: "/developer/rainbowkit-celo",
// label: "Rainbowkit-Celo",
// },
// {
// to: "/developer/web3modal",
// label: "Web3Modal SDK",
// },
// {
// to: "https://github.com/heymateag/celoiossdk",
// label: "iOS SDK",
// },
// {
// label: "Celo Composer",
// to: "https://github.com/celo-org/celo-composer#celo-composer",
// },
// ],
// },
{
href: "https://github.com/celo-org",
position: "right",
className: "header-github-link",
"aria-label": "GitHub repository",
},
],
},
algolia: {
appId: "55M4I38S60",
apiKey: "baed78b52be14ac907688f1dd70b41d5",
indexName: "celo",
contextualSearch: true,
debug: false,
},
footer: {
links: [
{
title: "Docs",
items: [
{
label: "Home",
to: "/",
},
{
label: "Docs GitHub",
href: "https://github.com/celo-org/docs",
},
],
},
{
title: "Community",
items: [
{
href: "/community/guidelines",
label: "Contributors",
},
{
label: "Forum",
href: "https://forum.celo.org/",
},
{
label: "Discord",
href: "https://chat.celo.org",
},
{
label: "Twitter",
href: "https://twitter.com/CeloOrg",
},
{
label: "Reddit",
href: "https://www.reddit.com/r/celo/",
},
{
href: "https://share.hsforms.com/1Qrhush1vSA2WIamd_yL4ow53n4j",
label: "Celo Signal Mailing List",
},
{
href: "https://calendar.google.com/calendar/u/0/[email protected]",
label: "Celo Signal Calendar",
},
{
href: "https://calendar.google.com/calendar/u/0/[email protected]",
label: "Community Calendar",
},
],
},
{
title: "Ecosystem",
items: [
{
label: "Celo Foundation",
href: "https://celo.org",
},
{
label: "Medium Blog",
href: "https://medium.com/celoorg",
},
{
label: "The Celo",
href: "https://thecelo.com/",
},
{
label: "Celo Hub",
href: "https://celohub.org/",
},
{
label: "Careers",
href: "https://celo.org/careers",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Celo Foundation, Inc. Built with Docusaurus.`,
},
fathomAnalytics: {
siteId: "AZMFWALB",
},
hubspot: {
accountId: 8568019,
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
editUrl: "https://github.com/celo-org/docs/edit/main/",
editUrl: ({ locale, versionDocsDirPath, docPath }) => {
// Link to Crowdin for French docs
if (locale !== DefaultLocale) {
return `https://celo.crowdin.com/celo-docs/${locale}`;
}
// Link to Github for English docs
return `https://github.com/celo-org/docs/edit/main/docs/${docPath}`;
},
routeBasePath: "/",
remarkPlugins: [
math,
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
],
rehypePlugins: [katex],
},
gtag: {
// You can also use your "G-" Measurement ID here.
trackingID: "G-0CXEKQ81V2",
// Optional fields.
anonymizeIP: true, // Should IPs be anonymized?
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
blog: false,
},
],
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css",
integrity:
"sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc",
crossorigin: "anonymous",
},
],
};