forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
341 lines (334 loc) · 10 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
// @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/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/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/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",
},
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: "Aztec Protocol",
},
{
type: "docSidebar",
sidebarId: "protocolSpecSidebar",
position: "left",
label: "Protocol Specification",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "/",
},
{
label: "Developer Quickstart",
to: "/getting_started",
},
{
label: "Aztec.nr",
to: "https://github.com/AztecProtocol/aztec-nr",
},
],
},
{
title: "Community",
items: [
{
label: "Discourse",
href: "https://discourse.aztec.network",
},
{
label: "Discord",
href: "https://discord.gg/DgWG2DBMyB",
},
{
label: "Twitter",
href: "https://twitter.com/aztecnetwork",
},
{
label: "Plonk Cafe",
href: "https://www.plonk.cafe/",
},
],
},
{
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: lightTheme,
darkTheme: darkTheme,
// 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",
// "solidity",
"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;