Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit f0392e3

Browse files
committed
feat: изменен внешний вид сайдбара
1 parent db7a3c6 commit f0392e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+5
-4
lines changed

docs/.vuepress/configs/sidebar/utils.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ export function getSideBar(dir: string, root: string, level: number = 1): Sideba
1111
if (stats.isDirectory()) {
1212
sideBarArray.push({
1313
text: entry,
14-
collapsible: ((level > 1) ? true : false),
14+
collapsible: level <= 2,
1515
children: getSideBar(entryPath, root, level + 1)
1616
})
1717
} else if (stats.isFile()) {
1818
if (!entry.match(/readme\.md/i)) {
1919
const splitEntry = entryPath.split(path.sep)
20-
sideBarArray.push(
21-
`/${splitEntry.slice(splitEntry.lastIndexOf(root)).join('/')}`
22-
)
20+
sideBarArray.push({
21+
text: path.basename(entry, '.md'),
22+
link: `/${splitEntry.slice(splitEntry.lastIndexOf(root)).join('/')}`
23+
})
2324
}
2425
}
2526
}

0 commit comments

Comments
 (0)