diff options
| author | 2026-02-04 10:38:50 +0800 | |
|---|---|---|
| committer | 2026-02-04 10:38:50 +0800 | |
| commit | f656803e7419dc0ccbfdf86752e3284472fed164 (patch) | |
| tree | ae5ae76c4ff6877eff885da75a1db14c43fa0182 /packages/docs/app/lib/layout.shared.tsx | |
| parent | 192abdf4d5e2b06feec3bb232bf25e334435e431 (diff) | |
| parent | ac7a7bceec82a02cf490bc928d989663fd8a3a30 (diff) | |
| download | DropOut-f656803e7419dc0ccbfdf86752e3284472fed164.tar.gz DropOut-f656803e7419dc0ccbfdf86752e3284472fed164.zip | |
docs: comprehensive documentation overhaul with i18n support (English & Chinese) (#78)
Diffstat (limited to 'packages/docs/app/lib/layout.shared.tsx')
| -rw-r--r-- | packages/docs/app/lib/layout.shared.tsx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/docs/app/lib/layout.shared.tsx b/packages/docs/app/lib/layout.shared.tsx index af2b6f0..6e90ba0 100644 --- a/packages/docs/app/lib/layout.shared.tsx +++ b/packages/docs/app/lib/layout.shared.tsx @@ -1,9 +1,24 @@ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'; +import { i18n } from './i18n'; -export function baseOptions(): BaseLayoutProps { +export function baseOptions(locale: string): BaseLayoutProps { + // 默认语言(zh)不显示前缀,其他语言显示前缀 + const isDefaultLocale = locale === i18n.defaultLanguage; + const localePrefix = isDefaultLocale ? '' : `/${locale}`; + return { + i18n, nav: { - title: 'React Router', + title: 'DropOut', + url: localePrefix || '/', }, + githubUrl: 'https://github.com/HydroRoll-Team/DropOut', + links: [ + { + type: 'main', + text: locale === 'zh' ? '文档' : 'Documentation', + url: `${localePrefix}/docs`, + }, + ], }; } |