forked from harvester/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
289 lines (285 loc) · 7.9 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
// @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');
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const config = {
title: "Harvester",
tagline: "The open-source hyperconverged infrastructure solution for a cloud-native world",
url: "https://docs.harvesterhci.io",
baseUrl: "/",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
organizationName: "harvester",
projectName: "docs",
i18n: {
defaultLocale: "en",
locales: ["en"],
localeConfigs: {
en: {
label: "English",
},
zh: {
label: "简体中文",
},
},
},
themes: ["docusaurus-theme-openapi-docs"],
presets: [
[
'classic',
({
docs: {
routeBasePath: '/',
sidebarPath: require.resolve("./sidebars.js"),
showLastUpdateTime: true,
editUrl: "https://github.com/harvester/docs/edit/main/",
docItemComponent: "@theme/ApiItem",
lastVersion: 'v1.3',
versions: {
current: {
label: 'v1.4 (dev)',
path: 'v1.4',
},
"v1.3": {
label: 'v1.3 (latest)',
path: 'v1.3',
banner: `none`
},
"v1.2": {
label: 'v1.2',
path: 'v1.2',
banner: `none`
},
"v1.1": {
path: "v1.1",
banner: `none`
},
"v1.0": {
path: "v1.0",
banner: `unmaintained`
}
}
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
googleTagManager: {
containerId: 'GTM-57KS2MW',
},
}),
],
],
themeConfig: {
zoom: {},
algolia: {
appId: 'U7QCSJFCWR',
apiKey: '954c1b1327687e818ef6930a5e8f8770',
indexName: 'harvester',
contextualSearch: true,
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
},
docs: {
sidebar: {
hideable: true,
},
},
navbar: {
logo: {
alt: "Harvester Logo",
src: "img/logo_horizontal.svg",
},
items: [
{
type: 'docsVersionDropdown',
position: 'left',
dropdownActiveClassDisabled: true,
},
{
type: 'docSidebar',
label: 'API',
position: 'left',
sidebarId: 'api',
},
{
type: "localeDropdown",
position: "left",
},
{
type: 'search',
position: 'left',
},
{
type: 'dropdown',
label: 'Quick Links',
position: 'right',
items: [
{
href: "https://harvesterhci.io/",
label: "Harvester Home",
},
{
href: 'https://github.com/harvester/harvester',
label: 'GitHub',
},
{
href: 'https://github.com/harvester/docs',
label: 'Docs GitHub',
},
{
href: "https://harvesterhci.io/kb",
label: "Knowledge Base",
},
{
href: "https://www.suse.com/c/?s=harvester",
label: "Blog",
},
],
},
{
type: 'dropdown',
label: 'More from SUSE',
position: 'right',
items: [
{
href: 'https://www.rancher.com',
label: 'Rancher',
className: 'navbar__icon navbar__rancher',
},
{
type: 'html',
value: '<hr style="margin: 0.3rem 0;">',
},
{
href: 'https://elemental.docs.rancher.com/',
label: 'Elemental',
className: 'navbar__icon navbar__elemental',
},
{
href: 'https://fleet.rancher.io/',
label: 'Fleet',
className: 'navbar__icon navbar__fleet',
},
{
href: 'https://rancherdesktop.io/',
label: 'Rancher Desktop',
className: 'navbar__icon navbar__rancherdesktop',
},
{
type: 'html',
value: '<hr style="margin: 0.3rem 0;">',
},
{
href: 'https://opensource.suse.com/',
label: 'More Projects...',
className: 'navbar__icon navbar__suse',
},
],
},
],
},
colorMode: {
// "light" | "dark"
defaultMode: "light",
// Hides the switch in the navbar
// Useful if you want to support a single color mode
disableSwitch: false,
},
footer: {
style: "dark",
links: [],
copyright: `Copyright © ${new Date().getFullYear()} SUSE Rancher. All Rights Reserved.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
languageTabs: [
{
highlight: "bash",
language: "curl",
logoClass: "bash",
},
{
highlight: "python",
language: "python",
logoClass: "python",
variant: "requests",
},
{
highlight: "go",
language: "go",
logoClass: "go",
},
{
highlight: "javascript",
language: "nodejs",
logoClass: "nodejs",
variant: "axios",
}
]
},
customFields: {
title: "Harvester - Open-source hyperconverged infrastructure",
description:
"The open-source hyperconverged infrastructure solution for a cloud-native world",
},
plugins: [
require.resolve('docusaurus-plugin-image-zoom'),
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{ // Redirects for links in the Harvester README.md file
to: '/v1.1/install/pxe-boot-install',
from: '/latest/install/pxe-boot-install'
},
],
},
],
[
"docusaurus-plugin-openapi-docs",
{
id: "api",
docsPluginId: "classic", // e.g. "classic" or the plugin-content-docs id
config: {
api: { // "api" is considered the <id> that you will reference in the CLI
specPath: "api/dev-swagger.json", // path or URL to the OpenAPI spec
outputDir: "docs/api", // output directory for generated *.mdx and sidebar.js files
sidebarOptions: {
groupPathsBy: "tag", // generate a sidebar.js slice that groups operations by tag
categoryLinkSource: "tag",
},
version: "dev", // Current version
label: "dev", // Current version label
baseUrl: "/dev/api", // Leading slash is important
versions: {
"v1.3": {
specPath: "api/v1.3-swagger.json",
outputDir: "versioned_docs/version-v1.3/api", // No trailing slash
label: "v1.3",
baseUrl: "/v1.3/api", // Leading slash is important
},
"v1.2": {
specPath: "api/v1.2-swagger.json",
outputDir: "versioned_docs/version-v1.2/api", // No trailing slash
label: "v1.2",
baseUrl: "/v1.2/api", // Leading slash is important
},
"v1.1": {
specPath: "api/v1.1-swagger.json",
outputDir: "versioned_docs/version-v1.1/api", // No trailing slash
label: "v1.1",
baseUrl: "/v1.1/api", // Leading slash is important
},
},
},
},
},
],
],
};
module.exports = config;