-
Notifications
You must be signed in to change notification settings - Fork 49
/
docusaurus.config.js
214 lines (209 loc) · 5.57 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
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const path = require("path");
const webpack = require("webpack");
module.exports = {
title: "ZeroTier Documentation",
tagline: "Because documentation makes things more good",
url: "https://docs.zerotier.com",
baseUrl: "/",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon-32x32.png",
organizationName: "zerotier", // Usually your GitHub org/user name.
projectName: "docs", // Usually your repo name.
plugins: [
path.resolve(__dirname, "matomo-plugin"), require.resolve('docusaurus-lunr-search'),
async function customPlugin(context, opts) {
return {
name: 'custom-plugin',
configureWebpack(config, isServer, utils, content) {
// Modify internal webpack config. If returned value is an Object, it
// will be merged into the final config using webpack-merge;
// If the returned value is a function, it will receive the config as the 1st argument and an isServer flag as the 2nd argument.
return {
plugins: [
new webpack.DefinePlugin({
// IMPORTANT: To fix debug library‘s bug
// {}.DEBUG = namespaces; // SyntaxError: Unexpected token '.'
'process.env.DEBUG': 'process.env.DEBUG',
})
]
}
},
}
}
],
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
themeConfig: {
mermaid: {
theme: { light: 'neutral', dark: 'dark' },
},
// for some reason if python or java are enabled here, the OpenAPI docs go boom :(
prism: {
additionalLanguages: [
"rust",
"powershell",
"csharp",
"python",
"java",
"scala",
],
},
matomo: {
matomoUrl: "https://matomo.zerotier.com/",
siteId: "4",
},
// announcementBar: {
// id: 'support_us', // Any value that will identify this message.
// content:
// 'This banner is here to inform you that we have a new banner',
// backgroundColor: '#fafbfc', // Defaults to `#fff`.
// textColor: '#091E42', // Defaults to `#000`.
// isCloseable: false, // Defaults to `true`.
// },
colorMode: {
defaultMode: "light",
disableSwitch: false,
respectPrefersColorScheme: true,
},
separateCss: true,
navbar: {
title: "ZeroTier Documentation",
logo: {
alt: "ZeroTier Logo",
src: "img/ZeroTierIcon.png",
},
items: [
{
to: "https://www.zerotier.com",
label: "Home",
},
{
to: "https://www.zerotier.com/download",
label: "Install",
},
{
to: "https://my.zerotier.com/",
label: "Manage Networks",
},
{
to: "https://discuss.zerotier.com/",
label: "Community",
}
],
},
footer: {
style: "dark",
links: [
{
title: "ZeroTier",
items: [
{
label: "Home",
href: "https://www.zerotier.com",
},
{
label: "Downloads",
href: "https://www.zerotier.com/download/",
},
{
label: "Blog",
href: "https://www.zerotier.com/blog/",
},
{
label: "ZeroTier Central",
href: "https://my.zerotier.com",
},
],
},
{
title: "Docs",
items: [
{
label: "ZeroTier",
to: "https://docs.zerotier.com",
},
{
label: "SDK",
to: "sockets",
},
{
label: "Central REST API",
to: "/api/central/ref-v1",
},
{
label: "Service REST API",
to: "/api/service/ref-v1",
},
{
label: "DNS",
to: "dns",
},
],
},
{
title: "Community",
items: [
{
label: "Forum",
href: "https://discuss.zerotier.com",
},
{
label: "Mastodon",
href: "https://social.zerotier.com/@zerotier",
},
{
label: "Twitter",
href: "https://twitter.com/zerotier",
},
{
label: "GitHub",
href: "https://github.com/zerotier",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} ZeroTier, Inc.`,
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
editUrl: "https://github.com/zerotier/docs/edit/main/",
routeBasePath: "/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
[
"redocusaurus",
{
specs: [
{
route: "/api/central/ref-v1",
spec: "./static/openapi/centralv1.json",
},
{
route: "/api/service/ref-v1",
spec: "https://github.com/zerotier/zerotier-one-api-spec/releases/latest/download/openapi.yaml",
},
],
theme: {
primaryColor: "#FFB354",
redocOptions: {
hideDownloadButton: false,
},
},
},
],
],
};