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/routes/docs.tsx | 16 +++ packages/docs/app/routes/home.tsx | 173 +++++++++++++++++++++++++++++++++ packages/docs/app/routes/not-found.tsx | 7 ++ 3 files changed, 196 insertions(+) create mode 100644 packages/docs/app/routes/docs.tsx create mode 100644 packages/docs/app/routes/home.tsx create mode 100644 packages/docs/app/routes/not-found.tsx (limited to 'packages/docs/app/routes') 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`); +} diff --git a/packages/docs/app/routes/home.tsx b/packages/docs/app/routes/home.tsx new file mode 100644 index 0000000..66b5333 --- /dev/null +++ b/packages/docs/app/routes/home.tsx @@ -0,0 +1,173 @@ +import type { Route } from './+types/home'; +import { HomeLayout } from 'fumadocs-ui/layouts/home'; +import { baseOptions } from '@/lib/layout.shared'; +import { i18n } from '@/lib/i18n'; + +const texts = { + en: { + hero: { + title: 'DropOut Minecraft Launcher', + subtitle: 'Modern. Reproducible. Developer-Grade.', + description: 'Built with Tauri v2 and Rust for native performance and minimal resource usage', + start: 'Get Started', + features: 'Features', + }, + features: { + items: [ + { title: 'High Performance', desc: 'Built with Rust and Tauri for minimal resource usage and fast startup times' }, + { title: 'Modern UI', desc: 'Clean, distraction-free interface with Svelte 5 and Tailwind CSS 4' }, + { title: 'Secure Auth', desc: 'Microsoft OAuth 2.0 with device code flow and offline mode support' }, + { title: 'Mod Loaders', desc: 'Built-in support for Fabric and Forge with automatic version management' }, + { title: 'Java Management', desc: 'Auto-detection and integrated downloader for Adoptium JDK/JRE' }, + { title: 'Instance System', desc: 'Isolated game environments with independent configs and mods' }, + ] + }, + why: { + title: 'Why DropOut?', + items: [ + { q: 'Your instance worked yesterday but broke today?', a: '→ DropOut makes it traceable.' }, + { q: 'Sharing a modpack means zipping gigabytes?', a: '→ DropOut shares exact dependency manifests.' }, + { q: 'Java, loader, mods, configs drift out of sync?', a: '→ DropOut locks them together.' }, + ] + }, + cta: { + title: 'Ready to get started?', + desc: 'Check out the documentation to learn more about DropOut', + button: 'Read the Docs', + } + }, + zh: { + hero: { + title: 'DropOut Minecraft 启动器', + subtitle: '现代、可复现、开发者级', + description: '基于 Tauri v2 和 Rust 构建,拥有原生性能和极低的资源占用', + start: '开始使用', + features: '功能特性', + }, + features: { + items: [ + { title: '高性能', desc: '使用 Rust 和 Tauri 构建,资源占用最小,启动速度极快' }, + { title: '现代化界面', desc: '简洁、无干扰的界面,使用 Svelte 5 和 Tailwind CSS 4' }, + { title: '安全认证', desc: '支持微软 OAuth 2.0 设备代码流和离线模式' }, + { title: '模组支持', desc: '内置 Fabric 和 Forge 支持,自动管理版本' }, + { title: 'Java 管理', desc: '自动检测并集成 Adoptium JDK/JRE 下载器' }, + { title: '实例系统', desc: '独立的游戏环境,独立的配置和模组' }, + ] + }, + why: { + title: '为什么选择 DropOut?', + items: [ + { q: '你的实例昨天还能用,今天就坏了?', a: '→ DropOut 让它可追溯。' }, + { q: '分享模组包意味着打包数GB的文件?', a: '→ DropOut 分享精确的依赖清单。' }, + { q: 'Java、加载器、模组、配置不同步?', a: '→ DropOut 将它们锁定在一起。' }, + ] + }, + cta: { + title: '准备好开始了?', + desc: '查看文档以了解更多关于 DropOut 的信息', + button: '阅读文档', + } + } +}; + +export function meta({ params }: Route.MetaArgs) { + return [ + { title: 'DropOut - Modern Minecraft Launcher' }, + { name: 'description', content: 'A modern, reproducible, and developer-grade Minecraft launcher built with Tauri v2 and Rust.' }, + ]; +} + +export default function Home({ params }: Route.ComponentProps) { + const lang = (params.lang as 'en' | 'zh') || i18n.defaultLanguage; + const t = texts[lang]; + + // 默认语言(zh)不显示前缀,其他语言显示前缀 + const isDefaultLocale = lang === i18n.defaultLanguage; + const localePrefix = isDefaultLocale ? '' : `/${lang}`; + + return ( + +
+ {/* Hero Section */} +
+

+ {t.hero.title} +

+

+ {t.hero.subtitle} +

+

+ {t.hero.description} +

+ +
+ + {/* Launcher Showcase */} +
+
+ DropOut Launcher Interface +
+
+ + {/* Features Grid */} +
+ {t.features.items.map((item, i) => ( +
+

{item.title}

+

+ {item.desc} +

+
+ ))} +
+ + {/* Why DropOut Section */} +
+

{t.why.title}

+
+ {t.why.items.map((item, i) => ( +
+

+ {item.q} +
+ {item.a} +

+
+ ))} +
+
+ + {/* CTA Section */} +
+

{t.cta.title}

+

+ {t.cta.desc} +

+ + {t.cta.button} + +
+
+
+ ); +} diff --git a/packages/docs/app/routes/not-found.tsx b/packages/docs/app/routes/not-found.tsx new file mode 100644 index 0000000..1d9e041 --- /dev/null +++ b/packages/docs/app/routes/not-found.tsx @@ -0,0 +1,7 @@ +export function loader() { + throw new Response('Not Found', { status: 404 }); +} + +export default function NotFound() { + return null; +} -- cgit v1.2.3-70-g09d2