mirror of
				https://github.com/antd-tiny-vue/antd-tiny-vue.git
				synced 2025-11-01 01:01:44 +08:00 
			
		
		
		
	feat: add locale
This commit is contained in:
		
							
								
								
									
										9
									
								
								.vitepress/config/en-US/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.vitepress/config/en-US/index.ts
									
									
									
									
									
										Normal 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 | ||||
| }) | ||||
							
								
								
									
										10
									
								
								.vitepress/config/en-US/nav.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								.vitepress/config/en-US/nav.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| import type { DefaultTheme } from 'vitepress' | ||||
|  | ||||
| export const getNav = (): DefaultTheme.NavItem[] => { | ||||
|   return [ | ||||
|     { | ||||
|       text: 'Components', | ||||
|       link: '/components/' | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										18
									
								
								.vitepress/config/en-US/sidebar.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								.vitepress/config/en-US/sidebar.ts
									
									
									
									
									
										Normal 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/` | ||||
|       } | ||||
|     ] | ||||
|   } | ||||
| } | ||||
							
								
								
									
										9
									
								
								.vitepress/config/rewrites.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.vitepress/config/rewrites.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| export const getRewrites = (): Record<string, string> => { | ||||
|   return { | ||||
|     'site/index.md': 'index.md', | ||||
|     'site/index.zh-CN.md': 'zh-CN/index.md', | ||||
|     'site/components/index.md': 'components/index.md', | ||||
|     'site/components/index.zh-CN.md': 'zh-CN/components/index.md', | ||||
|     'components/:btn/index.zh-CN.md': 'zh-CN/components/:btn/index.md' | ||||
|   } | ||||
| } | ||||
							
								
								
									
										9
									
								
								.vitepress/config/zh-CN/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.vitepress/config/zh-CN/index.ts
									
									
									
									
									
										Normal 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 | ||||
| }) | ||||
							
								
								
									
										10
									
								
								.vitepress/config/zh-CN/nav.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								.vitepress/config/zh-CN/nav.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| import type { DefaultTheme } from 'vitepress' | ||||
|  | ||||
| export const getNav = (): DefaultTheme.NavItem[] => { | ||||
|   return [ | ||||
|     { | ||||
|       text: '组件', | ||||
|       link: '/zh-CN/components/' | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										17
									
								
								.vitepress/config/zh-CN/sidebar.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								.vitepress/config/zh-CN/sidebar.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| import type { DefaultTheme } from 'vitepress' | ||||
| const componentsDir = `/zh-CN/components/` | ||||
|  | ||||
| export const getSidebar = (): DefaultTheme.Sidebar => { | ||||
|   return { | ||||
|     '/zh-CN/components/': [ | ||||
|       { | ||||
|         text: 'Button 按钮', | ||||
|         link: `${componentsDir}button/` | ||||
|       }, | ||||
|       { | ||||
|         text: 'ConfigProvider', | ||||
|         link: `${componentsDir}config-provider/` | ||||
|       } | ||||
|     ] | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user