Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Docs

on:
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/build_docs.yaml'
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/build_docs.yaml'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
- run: npm run build

check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
- run: npm run check
59 changes: 59 additions & 0 deletions .github/workflows/deploy_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy to GitHub Pages

on:
push:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/deploy_docs.yaml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 24 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# vscode
.vscode/
88 changes: 88 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# xLLM Documentation

[English](./README.md) | [简体中文](./README.zh-CN.md)

This repository contains the Astro + Starlight documentation site for
[xLLM](https://github.com/xLLM-AI/xllm), an LLM inference framework for
high-performance serving on domestic AI accelerators.

The site is built with Starlight and `starlight-theme-rapide`. It includes a
custom header, bilingual navigation, and a page-level `Copy page` action for
copying documentation content as Markdown.

## Documentation Structure

The documentation is maintained in two parallel language trees:

- English: `src/content/docs/en`
- Simplified Chinese: `src/content/docs/zh`

The root path redirects to the English documentation:

- `/` redirects to `/en/`
- `/en/` serves the English documentation
- `/zh/` serves the Simplified Chinese documentation

When adding or moving pages, keep matching relative paths in both language
trees so Starlight can switch between languages for the same topic.

## Project Layout

```text
.
├── astro.config.mjs # Starlight, locale, sidebar, and component config
├── package.json # npm scripts and dependencies
├── src/
│ ├── assets/ # Site-level assets such as the logo
│ ├── components/ # Starlight component overrides
│ ├── content/
│ │ └── docs/
│ │ ├── en/ # English documentation
│ │ ├── zh/ # Simplified Chinese documentation
│ │ └── assets/ # Documentation images and diagrams
│ ├── pages/index.astro # Redirect from / to /en/
│ └── styles/theme.css # Project theme customizations
└── public/ # Static public assets
```

## Local Development

Install dependencies:

```sh
npm install
```

Start the local development server:

```sh
npm run dev
```

Build the production site:

```sh
npm run build
```

Preview the production build:

```sh
npm run preview
```

## Editing Documentation

- Put user-facing content under `src/content/docs/en` and
`src/content/docs/zh`.
- Keep English and Chinese files aligned by path when a page exists in both
languages.
- Store shared documentation images in `src/content/docs/assets`.
- Update the `sidebar` section in `astro.config.mjs` when adding new sections
that should appear in navigation.
- Run `npm run build` before submitting changes to catch broken routes,
frontmatter errors, and Starlight content issues.

## Related Repository

- xLLM source code: <https://github.com/xLLM-AI/xllm>
84 changes: 84 additions & 0 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# xLLM 文档站

[English](./README.md) | [简体中文](./README.zh-CN.md)

本仓库是 [xLLM](https://github.com/xLLM-AI/xllm) 的 Astro + Starlight
文档站。xLLM 是面向国产 AI 加速器的高性能大语言模型推理框架。

站点基于 Starlight 和 `starlight-theme-rapide` 构建,包含自定义顶部导航、
中英文切换,以及用于将文档正文复制为 Markdown 的 `Copy page` 页面操作。

## 文档结构

文档内容按语言维护在两个并行目录中:

- 英文:`src/content/docs/en`
- 简体中文:`src/content/docs/zh`

当前站点路由规则如下:

- `/` 重定向到 `/en/`
- `/en/` 对应英文文档
- `/zh/` 对应简体中文文档

新增或移动页面时,请尽量在两个语言目录中保持相同的相对路径,方便 Starlight
在同一主题的不同语言版本之间切换。

## 项目结构

```text
.
├── astro.config.mjs # Starlight、语言、侧边栏和组件配置
├── package.json # npm 脚本和依赖
├── src/
│ ├── assets/ # 站点级资源,例如 logo
│ ├── components/ # Starlight 组件覆盖
│ ├── content/
│ │ └── docs/
│ │ ├── en/ # 英文文档
│ │ ├── zh/ # 简体中文文档
│ │ └── assets/ # 文档图片和架构图
│ ├── pages/index.astro # 从 / 重定向到 /en/
│ └── styles/theme.css # 项目主题样式
└── public/ # 静态公共资源
```

## 本地开发

安装依赖:

```sh
npm install
```

启动本地开发服务:

```sh
npm run dev
```

构建生产站点:

```sh
npm run build
```

预览生产构建结果:

```sh
npm run preview
```

## 编辑文档

- 面向用户的文档内容放在 `src/content/docs/en` 和 `src/content/docs/zh`。
- 同一个页面同时存在中英文版本时,尽量保持两个文件的相对路径一致。
- 共享的文档图片放在 `src/content/docs/assets`。
- 新增需要出现在导航中的章节时,更新 `astro.config.mjs` 中的 `sidebar`
配置。
- 提交前运行 `npm run build`,用于检查路由、frontmatter 和 Starlight
内容问题。

## 相关仓库

- xLLM 源码:<https://github.com/xLLM-AI/xllm>
Loading
Loading