-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
322 lines (318 loc) · 8.69 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
322 lines (318 loc) · 8.69 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const variableCodeTheme = require("./src/code-theme/code-theme");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Source Developer Portal",
tagline: "The Home of Source Developers",
url: "https://docs.source.network",
baseUrl: "/",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
trailingSlash: true,
organizationName: "source-developer", // Usually your GitHub org/user name.
projectName: "source-developer", // Usually your repo name.
presets: [
[
"docusaurus-preset-openapi",
/** @type {import('docusaurus-preset-openapi').Options} */
({
api: {
path: "openapi.yml",
routeBasePath: "/sourcehub/api",
},
docs: false, // Disable the default docs plugin
proxy: false, // Disable the proxy plugin to avoid webpack-dev-server config errors
theme: {
customCss: require.resolve("./src/css/custom.scss"),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
colorMode: {
respectPrefersColorScheme: false,
defaultMode: "dark",
},
navbar: {
title: null,
hideOnScroll: false,
logo: {
alt: "Source Network Documentation",
src: "img/source-docs-logo_v2.svg",
srcDark: "img/source-docs-logo-w_v2.svg",
},
items: [
{
type: "docSidebar",
position: "left",
docsPluginId: "defradb",
sidebarId: "defraSidebar",
label: "DefraDB",
className: "header-docs-link-defra",
},
{
type: "docSidebar",
position: "left",
docsPluginId: "sourcehub",
sidebarId: "sourcehubSidebar",
label: "SourceHub",
className: "header-docs-link-sourcehub",
},
{
type: "docSidebar",
position: "left",
docsPluginId: "orbis",
sidebarId: "orbisSidebar",
label: "Orbis",
className: "header-docs-link-orbis",
},
{
type: "docSidebar",
position: "left",
docsPluginId: "lensvm",
sidebarId: "lensvmSidebar",
label: "LensVM",
className: "header-docs-link-lensvm",
},
{
type: "docsVersionDropdown",
position: "right",
dropdownItemsAfter: [],
dropdownActiveClassDisabled: true,
},
{
href: "https://github.com/sourcenetwork/docs.source.network",
"aria-label": "GitHub repository",
className: "header-github-link",
position: "right",
},
],
},
footer: {
logo: {
alt: "Facebook Open Source Logo",
src: "img/source-logo_v2.svg",
srcDark: "img/source-logo-w_v2.svg",
href: "https://source.network",
},
links: [
{
title: "Developers",
items: [
{
label: "Getting Started",
to: "/",
},
{
label: "GitHub",
href: "https://github.com/sourcenetwork",
},
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://source.network/discord",
},
{
label: "Twitter",
href: "https://x.com/edgeofsource",
},
],
},
{
title: "About",
items: [
{
label: "About Us",
href: "https://source.network/about",
},
{
label: "Privacy Policy",
href: "https://source.network/privacy",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Source, Inc & Democratized Data Foundation. Built with Docusaurus.`,
},
prism: {
theme: variableCodeTheme,
},
algolia: {
appId: "N3M9YBYYQY",
apiKey: "909584ed5214e2d24ae2a85a5cd8664a",
indexName: "source-docs",
},
}),
clientModules: [],
plugins: [
[
require.resolve("./src/plugins/plausible"),
{
domain: "docs.source.network",
plausibleDomain: "plausible.source.network",
scriptName: "script",
trackOutboundLinks: true,
},
],
[
"docusaurus-plugin-sass",
{
sassOptions: {
includePaths: ["./src/css"],
},
},
],
// DefraDB instance
[
"@docusaurus/plugin-content-docs",
{
id: "defradb",
path: "docs/defradb",
routeBasePath: "defradb",
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
"https://github.com/sourcenetwork/docs.source.network/edit/master/",
lastVersion: "0.19.0",
versions: {
"0.19.0": {
banner: "none",
},
current: {
label: "Next",
path: "next",
banner: "unreleased",
},
},
// Reorder changelog sidebar
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return reverseSidebarChangelog(sidebarItems);
},
},
],
// SourceHub instance
[
"@docusaurus/plugin-content-docs",
{
id: "sourcehub",
path: "docs/sourcehub",
routeBasePath: "sourcehub",
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
"https://github.com/sourcenetwork/docs.source.network/edit/master/",
lastVersion: "0.3.2",
versions: {
"0.3.2": {
banner: "none",
},
current: {
label: "Next",
path: "next",
banner: "unreleased",
},
},
// Reorder changelog sidebar
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return reverseSidebarChangelog(sidebarItems);
},
},
],
// Orbis instance
[
"@docusaurus/plugin-content-docs",
{
id: "orbis",
path: "docs/orbis",
routeBasePath: "orbis",
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
"https://github.com/sourcenetwork/docs.source.network/edit/master/",
lastVersion: "0.2.3",
versions: {
"0.2.3": {
banner: "none",
},
current: {
label: "Next",
path: "next",
banner: "unreleased",
},
},
// Reorder changelog sidebar
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return reverseSidebarChangelog(sidebarItems);
},
},
],
// LensVM instance
[
"@docusaurus/plugin-content-docs",
{
id: "lensvm",
path: "docs/lensvm",
routeBasePath: "lensvm",
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
"https://github.com/sourcenetwork/docs.source.network/edit/master/",
lastVersion: "0.9.3",
versions: {
"0.9.3": {
banner: "none",
},
current: {
label: "Next",
path: "next",
banner: "unreleased",
},
},
// Reorder changelog sidebar
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return reverseSidebarChangelog(sidebarItems);
},
},
],
],
customFields: {
docsData: {},
},
};
module.exports = config;
// Reverse the sidebar items ordering (including nested category items)
function reverseSidebarChangelog(items) {
// Reverse items in categories
const result = items.map((item) => {
if (item.type === "category" && item.label == "Release Notes") {
return { ...item, items: item.items.reverse() };
}
return item;
});
return result;
}