-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
364 lines (344 loc) · 11.7 KB
/
docusaurus.config.js
File metadata and controls
364 lines (344 loc) · 11.7 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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
const path = require("path");
import "dotenv/config";
import platform_enterprise_latest_version from "./platform-enterprise_latest_version.js";
import {
createSeqeraConfig,
getSeqeraThemeConfig,
getSeqeraPresetOptions
} from "@seqera/docusaurus-preset-seqera";
export default async function createConfigAsync() {
const changelog = {
blogTitle: "Seqera Changelog",
blogDescription: "Blog",
blogSidebarCount: 5000,
blogSidebarTitle: "Changelog",
path: "changelog",
routeBasePath: "/changelog",
//processBlogPosts: () => ({}),
include: ["**/*.{md,mdx}"],
showReadingTime: false,
feedOptions: {
type: "all", // 'rss', 'atom', or both
title: "Seqera Changelog",
description: "Stay updated with our blog posts!",
copyright: `Copyright © ${new Date().getFullYear()} Seqera`,
},
onUntruncatedBlogPosts: "ignore",
};
const docs_platform_enterprise = [
"@docusaurus/plugin-content-docs",
{
id: "platform-enterprise",
routeBasePath: "/platform-enterprise",
path: "platform-enterprise_docs",
// For PR Previews we want to see the latest doc-set with expected changes.
includeCurrentVersion: process.env.INCLUDE_NEXT ? true : false,
lastVersion: platform_enterprise_latest_version,
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "platform-enterprise_docs/enterprise-sidebar.json",
},
];
const docs_platform_api = [
"@docusaurus/plugin-content-docs",
{
id: "platform-api",
routeBasePath: "/platform-api",
path: "platform-api-docs/docs",
remarkPlugins: [(await require("remark-yaml-to-table")).default],
sidebarPath: "platform-api-docs/docs/sidebar/sidebar.js",
docItemComponent: "@theme/ApiItem",
},
];
const docs_platform_cli = [
"@docusaurus/plugin-content-docs",
{
id: "platform-cli",
routeBasePath: "/platform-cli",
path: "platform-cli-docs/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
sidebarPath: "platform-cli-docs/docs/sidebar/sidebar.js",
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
},
];
const docs_platform_cloud = [
"@docusaurus/plugin-content-docs",
{
id: "platform-cloud",
routeBasePath: "/platform-cloud",
path: "platform-cloud/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "./platform-cloud/cloud-sidebar.json",
},
];
const docs_multiqc = [
"@docusaurus/plugin-content-docs",
{
id: "multiqc",
routeBasePath: "/multiqc",
path: "multiqc_docs/multiqc_repo/docs/markdown",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: ({ docPath }) => {
return `https://github.com/MultiQC/MultiQC/blob/main/docs/markdown/${docPath.replace("multiqc_docs/multiqc_repo/docs", "")}`;
},
sidebarPath: "./multiqc_docs/sidebar.js",
},
];
const docs_fusion = [
"@docusaurus/plugin-content-docs",
{
id: "fusion",
routeBasePath: "/fusion",
path: "fusion_docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: "https://github.com/seqeralabs/docs/tree/master/",
sidebarPath: "./fusion_docs/sidebar.json",
},
];
const docs_wave = [
"@docusaurus/plugin-content-docs",
{
id: "wave",
routeBasePath: "/wave",
path: "wave_docs/wave_repo/docs",
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
(await import("docusaurus-remark-plugin-tab-blocks")).default,
(await require("remark-yaml-to-table")).default,
(await import("remark-deflist")).default,
],
rehypePlugins: [require("rehype-katex")],
editUrl: ({ docPath }) => {
return `https://github.com/seqeralabs/wave/blob/master/docs/${docPath.replace("wave_docs/wave_repo/docs", "")}`;
},
sidebarPath: "./wave_docs/sidebar.json",
},
];
console.log(
"\n EXCLUDE_CHANGELOG: " + (process.env.EXCLUDE_CHANGELOG ? true : false),
"\n EXCLUDE_PLATFORM_ENTERPRISE: " +
(process.env.EXCLUDE_PLATFORM_ENTERPRISE ? true : false),
"\n EXCLUDE_PLATFORM_CLOUD: " +
(process.env.EXCLUDE_PLATFORM_CLOUD ? true : false),
"\n EXCLUDE_PLATFORM_API: " +
(process.env.EXCLUDE_PLATFORM_API ? true : false),
"\n EXCLUDE_PLATFORM_CLI: " +
(process.env.EXCLUDE_PLATFORM_CLI ? true : false),
"\n EXCLUDE_PLATFORM_OPENAPI: " +
(process.env.EXCLUDE_PLATFORM_OPENAPI ? true : false),
"\n EXCLUDE_MULTIQC: " + (process.env.EXCLUDE_MULTIQC ? true : false),
"\n EXCLUDE_FUSION: " + (process.env.EXCLUDE_FUSION ? true : false),
"\n EXCLUDE_WAVE: " + (process.env.EXCLUDE_WAVE ? true : false),
"\n INCLUDE_NEXT: " + (process.env.INCLUDE_NEXT ? true : false),
);
return createSeqeraConfig({
title: "Seqera Docs",
tagline: "Documentation for Seqera products",
url: "https://docs.seqera.io",
/*
* Enable faster Docusaurus optimizations (experimental v4 features)
* Reference: https://github.com/facebook/docusaurus/issues/10556
*
* WARNING: swcJsMinimizer & lightningCssMinimizer are disabled due to memory issues
* - Cause excessive memory usage leading to build failures
* - The believe is that our 22k of OpenAPI docs causes this issue due to the way they are generated.
* - See: https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/1025
*
* These optimizations may require additional configuration when memory issues are resolved.
*/
future: {
experimental_faster: {
swcJsLoader: false,
swcJsMinimizer: false,
swcHtmlMinimizer: false,
lightningCssMinimizer: false,
rspackBundler: true,
rspackPersistentCache: false,
mdxCrossCompilerCache: false,
},
},
// If you aren't using GitHub pages, you don't need these.
organizationName: "seqeralabs", // Usually your GitHub org/user name.
projectName: "docs", // Usually your repo name.
onBrokenLinks:
process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
onBrokenAnchors:
process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
markdown: {
hooks: {
onBrokenMarkdownLinks:
process.env.FAIL_ON_BROKEN_LINKS === "true" ? "throw" : "warn",
},
},
customFields: {
// Put your custom environment here
},
clientModules: [
require.resolve('./src/client-modules/cross-site-nav.js'),
require.resolve('./src/client-modules/posthog-search.js'),
],
presets: [
[
"@seqera/docusaurus-preset-seqera",
await getSeqeraPresetOptions({
blog: process.env.EXCLUDE_CHANGELOG ? false : changelog,
docs: false,
theme: {
customCss: require.resolve("./src/custom.css"),
},
openapi: process.env.EXCLUDE_PLATFORM_OPENAPI
? false
: {
id: "api",
docsPluginId: "platform-api",
config: {
platform: {
specPath: "platform-api-docs/scripts/specs/seqera-api-latest-decorated.yml",
outputDir: "platform-api-docs/docs",
sidebarOptions: {
groupPathsBy: "tag",
},
},
},
},
gtag: {
trackingID: "G-NR1CNM213G",
anonymizeIP: true,
},
googleTagManager: {
containerId: "GTM-MBCJKK4",
},
}),
],
],
plugins: [
process.env.EXCLUDE_PLATFORM_ENTERPRISE ? null : docs_platform_enterprise,
process.env.EXCLUDE_PLATFORM_CLOUD ? null : docs_platform_cloud,
process.env.EXCLUDE_PLATFORM_API ? null : docs_platform_api,
process.env.EXCLUDE_PLATFORM_CLI ? null : docs_platform_cli,
process.env.EXCLUDE_MULTIQC ? null : docs_multiqc,
process.env.EXCLUDE_FUSION ? null : docs_fusion,
process.env.EXCLUDE_WAVE ? null : docs_wave,
// Disable expensive bundler options.
// https://github.com/facebook/docusaurus/pull/11176
function disableExpensiveBundlerOptimizationPlugin() {
return {
name: 'disable-expensive-bundler-optimizations',
configureWebpack(_config) {
return {
optimization: {
concatenateModules: false,
},
};
},
};
},
],
themeConfig: getSeqeraThemeConfig({
typesense: {
typesenseCollectionName: 'seqera_docs',
searchPagePath: '/search',
typesenseServerConfig: {
nodes: [
{
host: 'uk4gflrza0d8yx5sp-1.a1.typesense.net',
port: 443,
protocol: 'https',
},
],
apiKey: 'KZsuSjc7jPqDm7pkl1kN8TkoHH9b3dwY',
connectionTimeoutSeconds: 2,
},
typesenseSearchParameters: {
query_by: 'content,hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3',
group_by: 'url_without_anchor',
group_limit: 1,
num_typos: 1,
prioritize_exact_match: true,
filter_by: 'docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list]', // TODO Remove once the scraper is updated
},
contextualSearch: false,
placeholder: 'Search Seqera docs...',
},
prism: {
additionalLanguages: [
"bash",
"docker",
"groovy",
"ini",
"java",
"javascript",
"json",
"nextflow",
"nginx",
"python",
"r",
"shell-session",
"sql",
"typescript",
"yaml",
],
},
navbar: {
items: [
{
label: 'Cloud',
href: '/platform-cloud/',
},
{
label: 'Enterprise',
href: '/platform-enterprise/',
},
{
label: 'Nextflow',
href: '/nextflow/',
},
{
label: 'MultiQC',
href: '/multiqc/',
},
{
label: 'Wave',
href: '/wave/',
},
{
label: 'Fusion',
href: '/fusion/',
},
],
},
}),
});
}