aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/docs/app/routes.ts
diff options
context:
space:
mode:
authorNtskwK <natsukawa247@outlook.com>2026-02-03 11:19:09 +0800
committerNtskwK <natsukawa247@outlook.com>2026-02-03 11:19:09 +0800
commitb27777b625fb348f35e435276842668e16456967 (patch)
tree8b9b05b075f762a541ffb4e027875051fe9f00e5 /packages/docs/app/routes.ts
parent9627912c1f7910f786c555a3a9485f0a8c4211bf (diff)
downloadDropOut-b27777b625fb348f35e435276842668e16456967.tar.gz
DropOut-b27777b625fb348f35e435276842668e16456967.zip
feat(i18n): add multi-language support for docs
Diffstat (limited to 'packages/docs/app/routes.ts')
-rw-r--r--packages/docs/app/routes.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/docs/app/routes.ts b/packages/docs/app/routes.ts
index 9acc429..2997ecf 100644
--- a/packages/docs/app/routes.ts
+++ b/packages/docs/app/routes.ts
@@ -1,9 +1,16 @@
-import { index, route, type RouteConfig } from '@react-router/dev/routes';
+import { route, type RouteConfig } from '@react-router/dev/routes';
export default [
- index('routes/home.tsx'),
- route('docs', 'routes/docs.tsx'),
- route('docs/*', 'docs/page.tsx'),
- route('api/search', 'docs/search.ts'),
- route('*', 'routes/not-found.tsx'),
+ // Home routes: / and /:lang
+ route(':lang?', 'routes/home.tsx', { id: 'home' }),
+
+ // Docs routes: /docs/* and /:lang/docs/*
+ route(':lang?/docs', 'routes/docs.tsx', { id: 'docs' }),
+ route(':lang?/docs/*', 'docs/page.tsx', { id: 'docs-page' }),
+
+ // API routes
+ route('api/search', 'docs/search.ts', { id: 'api-search' }),
+
+ // Catch-all 404
+ route('*', 'routes/not-found.tsx', { id: 'not-found' }),
] satisfies RouteConfig;