forked from iotaledger/iota-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contentPlugins.js
102 lines (93 loc) · 2.49 KB
/
contentPlugins.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
const { generatePluginConfig } = require('./src/utils/pluginConfigGenerators');
const {
buildPluginsConfig,
maintainPluginsConfig,
} = require('./versionedConfig');
const path = require('path');
module.exports = async () => {
const { SELECTED_SECTION = 'all' } = process.env;
const buildPlugins = [
{
id: 'build',
globalSidebars: ['build'],
path: path.resolve(__dirname, 'docs/build/getting-started'),
sidebarPath: path.resolve(
__dirname,
'docs/build/getting-started/sidebars.ts',
),
routeBasePath: 'build',
},
...generatePluginConfig(buildPluginsConfig, __dirname + '/docs/build/'),
{
id: 'introduction-docs-stardust',
path: path.resolve(
__dirname,
'docs/build/introduction-docs/stardust/docs',
),
routeBasePath: 'introduction',
sidebarPath: path.resolve(
__dirname,
'docs/build/introduction-docs/stardust/sidebars.js',
),
versions: {
current: {
label: 'Stardust',
path: 'stardust',
badge: true,
},
},
},
];
const maintainPlugins = [
...generatePluginConfig(
maintainPluginsConfig,
__dirname + '/docs/maintain/',
),
{
id: 'maintain',
globalSidebars: ['maintain'],
path: path.resolve(__dirname, 'docs/maintain/getting-started'),
sidebarPath: path.resolve(
__dirname,
'docs/maintain/getting-started/sidebars.ts',
),
routeBasePath: 'maintain',
},
];
const getStartedPlugins = [
{
id: 'get-started',
path: path.resolve(__dirname, 'docs/get-started'),
sidebarPath: path.resolve(__dirname, 'docs/get-started/sidebars.ts'),
routeBasePath: 'get-started',
},
];
const learnPlugins = [
{
id: 'learn',
path: path.resolve(__dirname, 'docs/learn'),
sidebarPath: path.resolve(__dirname, 'docs/learn/sidebars.ts'),
routeBasePath: 'learn',
},
];
const allPlugins = [
...learnPlugins,
...getStartedPlugins,
{
id: 'community',
path: path.resolve(__dirname, 'docs/community'),
sidebarPath: path.resolve(__dirname, 'docs/community/sidebars.ts'),
routeBasePath: 'community',
},
...buildPlugins,
...maintainPlugins,
];
const sectionPluginMap = {
build: buildPlugins,
maintain: maintainPlugins,
'get-started': getStartedPlugins,
learn: learnPlugins,
all: allPlugins,
};
return sectionPluginMap[SELECTED_SECTION];
};