feat: add locale

This commit is contained in:
2023-04-16 18:09:13 +08:00
parent f394f48853
commit 9f19ed8c74
25 changed files with 1434 additions and 944 deletions

View File

@ -0,0 +1,9 @@
import type { DefaultTheme } from 'vitepress'
import { getNav } from './nav'
import { getSidebar } from './sidebar'
export default (): DefaultTheme.Config => ({
nav: getNav(),
sidebar: getSidebar(),
i18nRouting: true
})

View File

@ -0,0 +1,10 @@
import type { DefaultTheme } from 'vitepress'
export const getNav = (): DefaultTheme.NavItem[] => {
return [
{
text: 'Components',
link: '/components/'
}
]
}

View File

@ -0,0 +1,18 @@
import type { DefaultTheme } from 'vitepress'
const componentsDir = `/components/`
export const getSidebar = (): DefaultTheme.Sidebar => {
return {
'/components/': [
{
text: 'Button',
link: `${componentsDir}button/`
},
{
text: 'ConfigProvider',
link: `${componentsDir}config-provider/`
}
]
}
}