forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
438 lines (431 loc) · 13.3 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const { themes } = require("prism-react-renderer");
const lightTheme = themes.github;
const darkTheme = themes.dracula;
import math from "remark-math";
import katex from "rehype-katex";
const path = require("path");
const fs = require("fs");
const macros = require("./src/katex-macros.js");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Privacy-first zkRollup | Aztec Documentation",
tagline:
"Aztec introduces a privacy-centric zkRollup solution for Ethereum, enhancing confidentiality and scalability within the Ethereum ecosystem.",
url: "https://docs.aztec.network/",
baseUrl: "/",
trailingSlash: false,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: process.env.ENV === "dev" ? "warn" : "throw",
favicon: "img/Aztec_icon_minified.svg",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "Aztec Network", // Usually your GitHub org/user name.
projectName: "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: {
defaultLocale: "en",
locales: ["en"],
},
markdown: {
mermaid: true,
},
themes: ["@docusaurus/theme-mermaid"],
presets: [
[
"@docusaurus/preset-classic",
/** @type {import('@docusaurus/preset-classic').Options} */
{
docs: {
path: process.env.ENV === "dev" ? "docs" : "processed-docs",
sidebarPath: "./sidebars.js",
editUrl: (params) => {
return (
`https://github.com/AztecProtocol/aztec-packages/edit/master/docs/docs/` +
params.docPath
);
},
routeBasePath: "/",
include: ["**/*.{md,mdx}"],
remarkPlugins: [math],
rehypePlugins: [
[
katex,
{
throwOnError: true,
globalGroup: true,
macros,
},
],
],
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
],
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",
},
],
plugins: [
async function loadVersions(context, options) {
// ...
return {
name: "load-versions",
async loadContent() {
try {
const aztecVersionPath = path.resolve(
__dirname,
"../.release-please-manifest.json"
);
const aztecVersion = JSON.parse(
fs.readFileSync(aztecVersionPath).toString()
)["."];
return {
"aztec-packages": `aztec-packages-v${aztecVersion}`,
};
} catch (err) {
throw new Error(
`Error loading versions in docusaurus build. Check load-versions in docusaurus.config.js.\n${err}`
);
}
},
async contentLoaded({ content, actions }) {
// await actions.createData("versions.json", JSON.stringify(content));
actions.setGlobalData({ versions: content });
},
/* other lifecycle API */
};
},
[
"@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)
disableInDev: false,
},
],
[
"docusaurus-plugin-typedoc",
{
id: "aztecjs/pxe",
entryPoints: ["../yarn-project/circuit-types/src/interfaces/pxe.ts"],
tsconfig: "../yarn-project/circuit-types/tsconfig.json",
entryPointStrategy: "expand",
out: "reference/developer_references/aztecjs/pxe",
readme: "none",
sidebar: {
categoryLabel: "Private Execution Environment (PXE)",
},
disableSources: true,
},
],
[
"docusaurus-plugin-typedoc",
{
id: "aztecjs/aztec-js",
entryPoints: [
"../yarn-project/aztec.js/src/contract/index.ts",
"../yarn-project/aztec.js/src/account/index.ts",
],
tsconfig: "../yarn-project/aztec.js/tsconfig.json",
entryPointStrategy: "resolve",
out: "reference/developer_references/aztecjs/aztec-js",
readme: "none",
sidebar: {
categoryLabel: "Aztec.js",
},
disableSources: true,
},
],
[
"docusaurus-plugin-typedoc",
{
id: "aztecjs/accounts",
entryPoints: [
"../yarn-project/accounts/src/defaults/index.ts",
"../yarn-project/accounts/src/ecdsa/index.ts",
"../yarn-project/accounts/src/schnorr/index.ts",
"../yarn-project/accounts/src/single_key/index.ts",
"../yarn-project/accounts/src/testing/index.ts",
],
tsconfig: "../yarn-project/accounts/tsconfig.json",
entryPointStrategy: "resolve",
out: "reference/developer_references/aztecjs/accounts",
readme: "none",
sidebar: {
categoryLabel: "Accounts",
},
disableSources: true,
},
],
// ["./src/plugins/plugin-embed-code", {}],
],
customFields: {
MATOMO_ENV: process.env.ENV,
},
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
metadata: [
{
name: "keywords",
content: "aztec, noir, privacy, encrypted, ethereum, blockchain",
},
],
image: "img/docs-preview-image.png",
algolia: {
appId: "CL4NK79B0W",
apiKey: "21d89dadaa37a4d1b6bf4b17978dcf7f",
indexName: "aztec",
contextualSearch: true,
customRanking: [
{ asc: 'importance' },
],
},
colorMode: {
defaultMode: "light",
disableSwitch: false,
respectPrefersColorScheme: false,
},
// docs: {
// sidebar: {
// hideable: true,
// autoCollapseCategories: false,
// },
// },
navbar: {
logo: {
alt: "Aztec Logo",
srcDark: "img/new_logo-01.svg",
href: "/",
src: "img/Aztec_logo_dark-01.svg",
},
items: [
{
type: "doc",
docId: "index",
position: "left",
label: "Learn",
},
{
type: "docSidebar",
sidebarId: "guidesSidebar",
position: "left",
label: "Guides",
},
{
type: "docSidebar",
sidebarId: "referenceSidebar",
position: "left",
label: "Reference",
},
{
type: "dropdown",
label: "Resources",
position: "left",
items: [
{
type: "html",
value: '<span class="dropdown-subtitle">GitHub</span>',
className: "dropdown-subtitle",
},
{
to: "https://github.com/AztecProtocol/aztec-starter",
label: "Aztec Starter repo",
target: "_blank",
rel: "noopener noreferrer",
className: "github-item",
},
{
to: "https://github.com/AztecProtocol/aztec-packages",
label: "Aztec Monorepo",
target: "_blank",
rel: "noopener noreferrer",
className: "github-item",
},
{
to: "https://github.com/AztecProtocol/aztec-nr",
label: "Aztec.nr",
target: "_blank",
rel: "noopener noreferrer",
className: "github-item",
},
{
to: "https://github.com/AztecProtocol/awesome-aztec",
label: "Awesome Aztec",
target: "_blank",
rel: "noopener noreferrer",
className: "github-item",
},
{
type: "html",
value: '<span class="dropdown-subtitle">Other Docs</span>',
className: "dropdown-subtitle",
},
{
to: "/migration_notes",
label: "Migration Notes",
className: "no-external-icon",
},
{
to: "/aztec_connect_sunset",
label: "Aztec Connect Sunset",
className: "no-external-icon",
},
{
type: "docSidebar",
sidebarId: "protocolSpecSidebar",
label: "Protocol Specification",
className: "no-external-icon",
},
{
type: "docSidebar",
sidebarId: "roadmapSidebar",
label: "Roadmap",
className: "no-external-icon",
},
{
to: "https://noir-lang.org/docs",
label: "Noir docs",
target: "_blank",
rel: "noopener noreferrer",
},
{
type: "html",
value: '<span class="dropdown-subtitle">Support</span>',
className: "dropdown-subtitle",
},
{
to: "https://airtable.com/appMhZd7lsZS3v27R/pagxWYAHYYrnrrXmm/form",
label: "Join community",
target: "_blank",
rel: "noopener noreferrer",
},
{
to: "https://x.com/aztecnetwork",
label: "X/Twitter",
target: "_blank",
rel: "noopener noreferrer",
className: "twitter-item",
},
],
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "/",
},
{
label: "Developer Getting Started Guide",
to: "/guides/getting_started",
},
{
label: "Aztec.nr",
to: "https://github.com/AztecProtocol/aztec-nr",
},
],
},
{
title: "Community",
items: [
{
label: "Forum",
href: "https://forum.aztec.network",
},
{
label: "Discord",
href: "https://discord.gg/DgWG2DBMyB",
},
{
label: "X (Twitter)",
href: "https://x.com/aztecnetwork",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/AztecProtocol",
},
{
label: "Awesome Aztec",
to: "https://github.com/AztecProtocol/awesome-aztec",
},
{
label: "Grants",
href: "https://aztec.network/grants",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Aztec, built with Docusaurus, powered by <a target="_blank" href="https://netlify.com">Netlify.</a>`,
},
prism: {
theme: themes.nightOwlLight,
darkTheme: themes.shadesOfPurple,
// darkTheme: themes.dracula,
// https://prismjs.com/#supported-languages
// Commented-out languages exists in `node_modules/prismjs/components/` so I'm not sure why they don't work.
additionalLanguages: [
"diff",
"rust",
"solidity",
"cpp",
"javascript",
// "typescript",
"json",
// "bash",
"toml",
"markdown",
"docker",
],
magicComments: [
// Remember to extend the default highlight class name as well!
{
className: "theme-code-block-highlighted-line",
line: "highlight-next-line",
block: { start: "highlight-start", end: "highlight-end" },
},
{
className: "code-block-error-line",
line: "this-will-error",
},
// This could be used to have release-please modify the current version in code blocks.
// However doing so requires to manually add each md file to release-please-config.json/extra-files
// which is easy to forget an error prone, so instead we rely on the AztecPackagesVersion() function.
{
line: "x-release-please-version",
block: {
start: "x-release-please-start-version",
end: "x-release-please-end",
},
className: "not-allowed-to-be-empty",
},
],
},
}),
};
module.exports = config;