This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
docusaurus.config.js
293 lines (288 loc) · 8.87 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const math = require("remark-math");
const katex = require("rehype-katex");
const path = require("path");
const fs = require("fs");
/** @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: "throw",
favicon: "img/Aztec_docs_icons-02.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: "processed-docs",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: (params) => {
return (
`https://github.com/AztecProtocol/aztec-packages/edit/master/docs/docs/` +
params.docPath
);
},
routeBasePath: "/",
remarkPlugins: [math],
rehypePlugins: [katex],
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
// removed until approved by legal (GDPR)
// gtag: {
// trackingID: "G-WSBTSFJCSF",
// anonymizeIP: true,
// }
}),
],
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.13.24/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 noirVersionPath = path.resolve(
__dirname,
"../yarn-project/noir-compiler/src/noir-version.json"
);
const noirVersion = JSON.parse(
fs.readFileSync(noirVersionPath).toString()
).tag;
const aztecVersionPath = path.resolve(
__dirname,
"../.release-please-manifest.json"
);
const aztecVersion = JSON.parse(
fs.readFileSync(aztecVersionPath).toString()
)["."];
return {
noir: noirVersion,
"aztec-packages": `aztec-packages-v${aztecVersion}`,
};
} catch (err) {
throw new Error(
`Error loading Noir version from noir-compiler 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: "apis/pxe",
entryPoints: ["../yarn-project/types/src/interfaces/pxe.ts"],
tsconfig: "../yarn-project/types/tsconfig.json",
entryPointStrategy: "expand",
out: "apis/pxe",
disableSources: true,
frontmatter: { sidebar_label: "Private Execution Environment (PXE)" },
},
],
[
"docusaurus-plugin-typedoc",
{
id: "apis/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: "apis/aztec-js",
disableSources: true,
},
],
// ["./src/plugins/plugin-embed-code", {}],
],
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",
src: "img/Aztec_logo_dark-01.svg",
},
items: [
{
type: "doc",
docId: "intro",
position: "left",
label: "Aztec Protocol",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "/",
},
{
label: "Developer Quickstart",
to: "/dev_docs/getting_started/quickstart",
},
],
},
{
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: "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: lightCodeTheme,
darkTheme: darkCodeTheme,
// 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: [
"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;