mirror of
https://github.com/snowykami/mbcp.git
synced 2025-08-02 03:30:01 +00:00
📝 优化文档显示
This commit is contained in:
@ -14,7 +14,42 @@ const commonSidebarOptions = {
|
||||
useFolderTitleFromIndexFile: true,
|
||||
useFolderLinkFromIndexFile: true,
|
||||
includeFolderIndexFile: true,
|
||||
rootGroupText: 'MBCP',
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate sidebar config
|
||||
* multiple languages and sections
|
||||
* @returns {any[]}
|
||||
*/
|
||||
function generateSidebarConfig(): any[] {
|
||||
let sections = ["api", "refer", "guide"]
|
||||
let languages = ['zh', 'en', 'ja', 'zht']
|
||||
let ret = []
|
||||
for (let language of languages) {
|
||||
for (let section of sections) {
|
||||
if (language === defaultLocale) {
|
||||
ret.push({
|
||||
basePath: `/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${section}/`,
|
||||
...commonSidebarOptions
|
||||
})
|
||||
} else {
|
||||
ret.push({
|
||||
basePath: `/${language}/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${language}/${section}/`,
|
||||
...commonSidebarOptions
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
console.log(generateSidebarConfig())
|
||||
|
||||
export const common = defineConfig({
|
||||
title: "MBCP docs",
|
||||
description: "MBCP library docs",
|
||||
@ -27,23 +62,7 @@ export const common = defineConfig({
|
||||
themeConfig: {
|
||||
sidebar: generateSidebar(
|
||||
[
|
||||
...[defaultLocale, 'en', 'ja', 'zht'].map((locale) => {
|
||||
if (locale === defaultLocale) {
|
||||
return {
|
||||
basePath: '/api/',
|
||||
scanStartPath: `${locale}/api`,
|
||||
resolvePath: '/api/',
|
||||
...commonSidebarOptions
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
basePath: `/${locale}/api/`,
|
||||
scanStartPath: `${locale}/api`,
|
||||
resolvePath: `/${locale}/api/`,
|
||||
...commonSidebarOptions
|
||||
}
|
||||
}
|
||||
})
|
||||
...generateSidebarConfig()
|
||||
]
|
||||
),
|
||||
socialLinks: [
|
||||
|
@ -6,6 +6,7 @@ export const en = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'Get Start', link: '/en/guide/'},
|
||||
{text: 'Reference', link: '/en/refer'},
|
||||
{text: 'API Document', link: '/en/api/'},
|
||||
{text: 'Demo', link: '/en/demo/'},
|
||||
],
|
||||
|
@ -6,6 +6,7 @@ export const ja = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'スタート', link: '/ja/guide/'},
|
||||
{text: 'リファレンス', link: '/ja/refer'},
|
||||
{text: 'APIドキュメント', link: '/ja/api/'},
|
||||
{text: 'インスタンス', link: '/ja/demo/'},
|
||||
],
|
||||
|
@ -6,6 +6,7 @@ export const zh = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '快速开始', link: '/guide/'},
|
||||
{text: '参考', link: '/refer'},
|
||||
{text: 'API文档', link: '/api/'},
|
||||
{text: '实例', link: '/demo/'},
|
||||
],
|
||||
|
@ -7,6 +7,7 @@ export const zht = defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '指引', link: '/zht/guide/'},
|
||||
{text: '參考', link: '/zht/refer'},
|
||||
{text: 'API文檔', link: '/zht/api/'},
|
||||
{text: '示範', link: '/zht/demo/'},
|
||||
],
|
||||
|
3
docs/en/refer/index.md
Normal file
3
docs/en/refer/index.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Reference
|
||||
help us to improve the documentation
|
||||
```
|
4
docs/ja/refer/index.md
Normal file
4
docs/ja/refer/index.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
3
docs/zh/refer/function/curry.md
Normal file
3
docs/zh/refer/function/curry.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: 柯里化
|
||||
---
|
3
docs/zh/refer/function/function.md
Normal file
3
docs/zh/refer/function/function.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: 函数
|
||||
---
|
8
docs/zh/refer/index.md
Normal file
8
docs/zh/refer/index.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: 参考
|
||||
---
|
||||
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
4
docs/zht/refer/index.md
Normal file
4
docs/zht/refer/index.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Reference
|
||||
|
||||
Help us to improve the documentation
|
||||
```
|
Reference in New Issue
Block a user