From 21ec63eaaf2ab1cb088f1c1787200a91cce460a5 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Tue, 10 Feb 2026 13:28:23 +0800 Subject: chore: sync with main [skip ci] (#91) Co-authored-by: NtskwK Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/docs/app/lib/layout.shared.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/docs/app/lib/layout.shared.tsx (limited to 'packages/docs/app/lib/layout.shared.tsx') diff --git a/packages/docs/app/lib/layout.shared.tsx b/packages/docs/app/lib/layout.shared.tsx new file mode 100644 index 0000000..6e90ba0 --- /dev/null +++ b/packages/docs/app/lib/layout.shared.tsx @@ -0,0 +1,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`, + }, + ], + }; +} -- cgit v1.2.3-70-g09d2