Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
10c560f
Initial plan
Copilot Jan 21, 2026
6db4a3b
docs: add comprehensive documentation for DropOut launcher
Copilot Jan 21, 2026
8254559
docs: add Chinese translations for documentation
Copilot Jan 21, 2026
fe0cb04
docs: configure i18n support and update documentation README
Copilot Jan 21, 2026
2ff4c75
docs: fix meta.json structure and build configuration for i18n
Copilot Jan 21, 2026
63707fa
docs: redesign home page with launcher showcase and fix routing
Copilot Jan 21, 2026
fa70f6f
Update packages/docs/content/docs/en/features/index.mdx
HsiangNianian Jan 22, 2026
6fdf5d2
Update packages/docs/content/docs/zh/troubleshooting.mdx
HsiangNianian Jan 22, 2026
d8e2571
Update packages/docs/content/docs/zh/troubleshooting.mdx
HsiangNianian Jan 22, 2026
d3b5ea2
Update packages/docs/content/docs/en/troubleshooting.mdx
HsiangNianian Jan 22, 2026
17f6e83
Update packages/docs/content/docs/en/troubleshooting.mdx
HsiangNianian Jan 22, 2026
ee8b60d
chore: Update favicon.ico in public directory
HsiangNianian Jan 22, 2026
a87268d
fix: update navigation title from 'React Router' to 'DropOut'
HsiangNianian Jan 22, 2026
c309904
feat(docs): enhance error boundary UI and add 404 page
NtskwK Jan 29, 2026
2f4f8a3
docs: fix relative links and image paths in documentation
NtskwK Jan 29, 2026
9627912
docs: remove emojis from documentation and home page
Copilot Jan 30, 2026
b27777b
feat(i18n): add multi-language support for docs
NtskwK Feb 3, 2026
ac7a7bc
docs: restructure documentation files
NtskwK Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 202 additions & 8 deletions packages/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,208 @@
# docs
# DropOut Documentation

This is a React Router application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
This is the official documentation site for DropOut Minecraft Launcher, built with [Fumadocs](https://fumadocs.dev) and React Router v7.

Run development server:
## Overview

The documentation covers:
- **Getting Started**: Installation and first-time setup
- **Features**: Detailed guides for all launcher features
- **Architecture**: Technical design and implementation details
- **Development**: Building and contributing to DropOut
- **Troubleshooting**: Common issues and solutions

### Multi-language Support

The documentation is available in:
- **English** (default) - `content/docs/en/`
- **简体中文** (Simplified Chinese) - `content/docs/zh/`

## Development

### Prerequisites

- Node.js 22+
- pnpm 9+

### Setup

Install dependencies:

```bash
pnpm install
```

### Run Development Server

```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```

This starts the development server at `http://localhost:5173` with hot reload enabled.

The documentation automatically supports language switching between English and Chinese.

### Build for Production

```bash
pnpm build
```

The production build will be output to the `build/` directory.

### Type Checking

```bash
pnpm types:check
```

### Linting and Formatting

```bash
# Check code
pnpm lint

# Format code
pnpm format
```

## Project Structure

```
packages/docs/
├── content/
│ └── docs/ # Documentation content (MDX)
│ ├── en/ # English documentation
│ │ ├── index.mdx
│ │ ├── getting-started.mdx
│ │ ├── architecture.mdx
│ │ ├── development.mdx
│ │ ├── troubleshooting.mdx
│ │ └── features/
│ └── zh/ # Chinese documentation
│ ├── index.mdx
│ ├── getting-started.mdx
│ ├── architecture.mdx
│ ├── development.mdx
│ ├── troubleshooting.mdx
│ └── features/
├── app/ # React Router app
├── public/ # Static assets
├── source.config.ts # Fumadocs configuration (i18n enabled)
└── react-router.config.ts # React Router configuration
```

## Internationalization (i18n)

### Structure

Documentation is organized by locale:
- English: `content/docs/en/`
- Chinese: `content/docs/zh/`

Each locale has the same structure with translated content.

### Configuration

i18n is configured in:
- `source.config.ts`: Enables i18n support
- `app/lib/source.ts`: Defines available languages and default

### Adding a New Language

1. Create a new directory: `content/docs/{locale}/`
2. Copy the structure from `en/` or `zh/`
3. Translate all `.mdx` files
4. Update `meta.json` files with translated titles
5. Add the language to `app/lib/source.ts`

## Writing Documentation

### MDX Format

All documentation is written in MDX (Markdown with JSX):

```mdx
---
title: Page Title
description: Page description for SEO
---

# Page Title

Content goes here...

<Cards>
<Card title="Link Title" href="/path" />
</Cards>
```

### Available Components

Fumadocs provides several components:

- `<Card>` - Link cards
- `<Cards>` - Card container
- `<Callout>` - Info/warning boxes
- `<Tabs>` - Tabbed content
- `<Steps>` - Numbered steps
- Code blocks with syntax highlighting

### Adding New Pages

1. Create new `.mdx` file in `content/docs/{locale}/`
2. Add frontmatter with title and description
3. Write content using MDX
4. Update `meta.json` to include the page
5. Repeat for all supported languages
6. Test locally with `pnpm dev`

### Translation Guidelines

When translating content:
- Keep all code blocks in English
- Translate frontmatter (title, description)
- Keep technical terms (Tauri, Rust, Svelte, etc.) in English
- Translate UI elements and descriptions
- Keep all links and URLs unchanged
- Maintain the same structure and formatting

### Organizing Content

Use `meta.json` files to organize navigation:

```json
{
"title": "Section Title",
"pages": [
"page1",
"page2",
{
"title": "Subsection",
"pages": ["sub1", "sub2"]
}
]
}
```

## Deployment

The documentation is automatically deployed when changes are merged to the main branch.

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes (in all supported languages)
4. Test locally
5. Submit a pull request

## Links

- [DropOut Repository](https://github.com/HydroRoll-Team/DropOut)
- [Fumadocs](https://fumadocs.dev)
- [React Router](https://reactrouter.com)

## License

MIT License - see the main repository for details.
51 changes: 29 additions & 22 deletions packages/docs/app/docs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,58 @@
import type { Route } from './+types/page';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';
import { DocsPage, DocsBody, DocsDescription, DocsTitle } from 'fumadocs-ui/page';
import { Card, Cards } from 'fumadocs-ui/components/card';
import { source } from '@/lib/source';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import browserCollections from 'fumadocs-mdx:collections/browser';
import { i18n } from '@/lib/i18n';
import { baseOptions } from '@/lib/layout.shared';
import { useFumadocsLoader } from 'fumadocs-core/source/client';
import browserCollections from 'fumadocs-mdx:collections/browser';

export async function loader({ params }: Route.LoaderArgs) {
const slugs = params['*'].split('/').filter((v) => v.length > 0);
const page = source.getPage(slugs);
if (!page) throw new Response('Not found', { status: 404 });
// 从路由参数获取语言,如果没有则使用默认语言
// URL 格式: /docs/getting-started (默认语言 zh)
// URL 格式: /en/docs/getting-started (英语)
const lang = (params.lang && i18n.languages.includes(params.lang as any))
? (params.lang as 'zh' | 'en')
: (i18n.defaultLanguage as 'zh' | 'en');

// 获取文档路径 slugs
const slugs = params['*']?.split('/').filter((v) => v.length > 0) || [];

const page = source.getPage(slugs, lang);

if (!page) {
throw new Response('Not found', { status: 404 });
}

return {
path: page.path,
pageTree: await source.serializePageTree(source.getPageTree()),
pageTree: await source.serializePageTree(source.getPageTree(lang)),
lang,
};
}

const clientLoader = browserCollections.docs.createClientLoader({
component(
{ toc, frontmatter, default: Mdx },
// you can define props for the `<Content />` component
props?: {
className?: string;
},
) {
component({ toc, frontmatter, default: Mdx }) {
return (
<DocsPage toc={toc} {...props}>
<title>{frontmatter.title}</title>
<meta name="description" content={frontmatter.description} />
<DocsPage toc={toc}>
<DocsTitle>{frontmatter.title}</DocsTitle>
<DocsDescription>{frontmatter.description}</DocsDescription>
<DocsBody>
<Mdx components={{ ...defaultMdxComponents }} />
<Mdx components={{ ...defaultMdxComponents, Card, Cards }} />
</DocsBody>
</DocsPage>
);
},
});

export default function Page({ loaderData }: Route.ComponentProps) {
const { path, pageTree } = useFumadocsLoader(loaderData);
export default function Page({ loaderData, params }: Route.ComponentProps) {
const { pageTree, lang } = useFumadocsLoader(loaderData);

return (
<DocsLayout {...baseOptions()} tree={pageTree}>
{clientLoader.useContent(path)}
<DocsLayout {...baseOptions(lang)} tree={pageTree}>
{clientLoader.useContent(loaderData.path)}
</DocsLayout>
);
}
7 changes: 5 additions & 2 deletions packages/docs/app/docs/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { createFromSource } from 'fumadocs-core/search/server';
import { source } from '@/lib/source';

const server = createFromSource(source, {
// https://docs.orama.com/docs/orama-js/supported-languages
language: 'english',
localeMap: {
zh: {
language: 'english',
},
},
});

export async function loader({ request }: Route.LoaderArgs) {
Expand Down
8 changes: 8 additions & 0 deletions packages/docs/app/lib/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineI18n } from 'fumadocs-core/i18n';

export const i18n = defineI18n({
defaultLanguage: 'zh',
languages: ['zh', 'en'],
hideLocale: 'default-locale',
parser: 'dir', // 使用目录结构 (content/zh/*, content/en/*)
});
19 changes: 17 additions & 2 deletions packages/docs/app/lib/layout.shared.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { i18n } from './i18n';

export function baseOptions(): BaseLayoutProps {
export function baseOptions(locale: string): BaseLayoutProps {
// 默认语言(zh)不显示前缀,其他语言显示前缀
const isDefaultLocale = locale === i18n.defaultLanguage;
const localePrefix = isDefaultLocale ? '' : `/${locale}`;

return {
i18n,
nav: {
title: 'React Router',
title: 'DropOut',
url: localePrefix || '/',
},
githubUrl: 'https://github.com/HydroRoll-Team/DropOut',
links: [
{
type: 'main',
text: locale === 'zh' ? '文档' : 'Documentation',
url: `${localePrefix}/docs`,
},
],
};
}
5 changes: 5 additions & 0 deletions packages/docs/app/lib/source.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { loader } from 'fumadocs-core/source';
import { docs } from 'fumadocs-mdx:collections/server';
import { i18n } from './i18n';

export const source = loader({
source: docs.toFumadocsSource(),
baseUrl: '/docs',
i18n,
// hideLocale: 'default-locale' 会自动生成正确的 URL:
// - 默认语言 (zh): /docs/getting-started
// - 其他语言 (en): /en/docs/getting-started
});
Loading