aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/docs/app/lib/layout.shared.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/docs/app/lib/layout.shared.tsx')
-rw-r--r--packages/docs/app/lib/layout.shared.tsx19
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`,
+ },
+ ],
};
}