From 21ec63eaaf2ab1cb088f1c1787200a91cce460a5 Mon Sep 17 00:00:00 2001
From: 简律纯 <i@jyunko.cn>
Date: Tue, 10 Feb 2026 13:28:23 +0800
Subject: chore: sync with main [skip ci] (#91)

Co-authored-by: NtskwK <natsukawa247@outlook.com>
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/routes/docs.tsx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 packages/docs/app/routes/docs.tsx

(limited to 'packages/docs/app/routes/docs.tsx')

diff --git a/packages/docs/app/routes/docs.tsx b/packages/docs/app/routes/docs.tsx
new file mode 100644
index 0000000..5154d27
--- /dev/null
+++ b/packages/docs/app/routes/docs.tsx
@@ -0,0 +1,16 @@
+import type { Route } from './+types/docs';
+import { redirect } from 'react-router';
+
+import { i18n } from '@/lib/i18n';
+
+export function loader({ params }: Route.LoaderArgs) {
+  const lang = params.lang as string | undefined;
+  
+  // 如果没有语言参数或是默认语言，重定向到 /docs/getting-started
+  if (!lang || lang === i18n.defaultLanguage) {
+    return redirect('/docs/getting-started');
+  }
+  
+  // 其他语言重定向到 /:lang/docs/getting-started
+  return redirect(`/${lang}/docs/getting-started`);
+}
-- 
cgit v1.2.3-70-g09d2

