aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/docs/app/lib/layout.shared.tsx
blob: 6e90ba087e97b6baf35a4e7902bf6f63c9dc4eb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { i18n } from './i18n';

export function baseOptions(locale: string): BaseLayoutProps {
  // 默认语言(zh)不显示前缀,其他语言显示前缀
  const isDefaultLocale = locale === i18n.defaultLanguage;
  const localePrefix = isDefaultLocale ? '' : `/${locale}`;
  
  return {
    i18n,
    nav: {
      title: 'DropOut',
      url: localePrefix || '/',
    },
    githubUrl: 'https://github.com/HydroRoll-Team/DropOut',
    links: [
      {
        type: 'main',
        text: locale === 'zh' ? '文档' : 'Documentation',
        url: `${localePrefix}/docs`,
      },
    ],
  };
}