-
Notifications
You must be signed in to change notification settings - Fork 54
/
docusaurus.config.js
39 lines (35 loc) · 1.19 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
const { link } = require('fs');
const path = require('path');
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-docs',
{
id: 'iota-tips',
path: path.resolve(__dirname, './'),
routeBasePath: 'tips',
editUrl: 'https://github.com/iotaledger/tips/edit/main/',
remarkPlugins: [require('remark-import-partial')],
include: ['tips/**/*.md', 'README.md'],
// Create own sidebar to flatten hierarchy and use own labeling
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const items = await defaultSidebarItemsGenerator(args);
const result = items[1].items.map((item) => {
if (item.type === 'category') {
if (item.link.type === 'doc') {
// Get TIP number and append TIP name
item.label = item.link.id.slice(-4) + '-' + item.label
}
}
return item;
});
return [items[0]].concat(result);
},
}
],
],
staticDirectories: [],
};