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
9 changes: 4 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.13'
cache: 'pip'

- run: |
pip install -r requirements.txt
mkdocs build
mkdir sites
mv site sites/clash
python build.py
python tests/check_site.py

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sites
publish_dir: site
cname: docs.watfaq.com
force_orphan: true
user_name: github-actions[bot]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
site/
.venv/
.cache/
.venv/
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# docs.watfaq.com/clash
# ClashRS 用户手册

## Development
本站用 Zensical 分别构建英文和简体中文手册。发布入口为 [docs.watfaq.com/clash/](https://docs.watfaq.com/clash/)。

```bash
# Install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install mkdocs
## 本地构建和预览

# Run development server
mkdocs serve
```
在本文档仓库根目录使用 Python 3.13 运行:

```sh
python -m pip install -r requirements.txt
python build.py
python tests/check_site.py
python -m http.server 8000 --bind 127.0.0.1 --directory site
```

打开 <http://127.0.0.1:8000/clash/> 选择语言。两套站点分别位于 `/clash/en/` 和 `/clash/zh/`。CI 使用相同的构建脚本,将 `site/` 发布到 GitHub Pages。

只预览一种语言并在编辑时自动刷新,可以使用 `zensical serve -f zensical.toml`(英文)或 `zensical serve -f zensical.zh.toml`(简体中文)。跨语言切换请使用上述双语预览。

## 维护文档

- 在 `docs/en/` 和 `docs/zh/` 使用相同的相对路径,语言菜单通过该路径切换到对应文章。
- 在 `zensical.toml` 和 `zensical.zh.toml` 中分别维护导航标题。尚未翻译的页面可以先在对应路径放入带有英文原文链接的简短说明。
- 两种语言的完整配置示例都引用 `shared/full-example.md`,修改示例只需编辑这一份文件。站点图标位于 `overrides/assets/images/`。
22 changes: 22 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Build the two manuals and their shared language selection page."""

import shutil
import subprocess
import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parent


def main():
for config in ("zensical.toml", "zensical.zh.toml"):
subprocess.run(
[sys.executable, "-m", "zensical", "build", "--clean", "--strict", "-f", config],
cwd=ROOT,
check=True,
)
shutil.copyfile(ROOT / "landing/index.html", ROOT / "site/clash/index.html")


if __name__ == "__main__":
main()
231 changes: 0 additions & 231 deletions docs/config/full.md

This file was deleted.

Loading
Loading