Skip to content

Commit 1f1233c

Browse files
author
dompling
committed
fix
1 parent e4a518a commit 1f1233c

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Deploy Docs
1+
name: Deploy Documentation
2+
23
on:
34
push:
45
branches:
5-
- main # 只有在推送到 main 分支时触发
6+
- main # 监听主分支推送
67

78
permissions:
89
contents: write
@@ -11,26 +12,28 @@ jobs:
1112
deploy:
1213
runs-on: ubuntu-latest
1314
steps:
14-
- uses: actions/checkout@v4
15+
- name: Checkout code
16+
uses: actions/checkout@v4
1517
with:
1618
fetch-depth: 0
1719

18-
- name: Setup Python
20+
- name: Set up Python
1921
uses: actions/setup-python@v5
2022
with:
2123
python-version: 3.x
24+
cache: 'pip' # 开启 pip 依赖缓存
2225

2326
- name: Install dependencies
2427
run: |
2528
pip install mkdocs-material
2629
27-
# 如果你不想移动文件,可以在这里用命令准备 docs 目录
28-
- name: Prepare docs folder
30+
- name: Prepare Workspace
2931
run: |
3032
mkdir -p docs
3133
cp README.md docs/index.md
3234
cp API.md docs/API.md
33-
cp API.en.md docs/API.en.md
35+
cp -r AppIcon.png docs/
36+
cp -r images docs/
3437
3538
- name: Build and Deploy
3639
run: mkdocs gh-deploy --force

mkdocs.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
1-
site_name: TrollScript Release
1+
site_name: TrollScript
2+
site_url: https://dompling.github.io/TrollScript-Release
3+
site_description: TrollScript 官方文档与 API 参考
4+
25
theme:
36
name: material
4-
language: zh # 设置界面为中文
7+
language: zh
8+
palette:
9+
# 自动切换深色/浅色模式
10+
- media: "(prefers-color-scheme: light)"
11+
scheme: default
12+
primary: teal
13+
accent: cyan
14+
toggle:
15+
icon: material/brightness-7
16+
name: 切换至深色模式
17+
- media: "(prefers-color-scheme: dark)"
18+
scheme: slate
19+
primary: teal
20+
accent: cyan
21+
toggle:
22+
icon: material/brightness-4
23+
name: 切换至浅色模式
524
features:
6-
- navigation.tabs # 顶部导航栏模式
7-
- content.code.copy # 代码复制按钮
25+
- navigation.instant # 页面即时加载 (SPA 体验)
26+
- navigation.tabs # 顶部标签页导航
27+
- navigation.tracking # 锚点跟随
28+
- content.code.copy # 代码块一键复制
29+
- search.suggest # 搜索建议
30+
- search.highlight # 搜索关键词高亮
831

932
nav:
1033
- 介绍: index.md # 默认会将仓库的 README.md 链接到这里(见下方说明)
1134
- API ZH 文档: API.md # 链接你的 API.md
12-
- API Document: API.en.md # 链接你的 API.md
35+
- API Document: API.en.md # 链接你的 API.md
36+
37+
markdown_extensions:
38+
- admonition # 警告/提示框
39+
- pymdownx.details # 折叠详情
40+
- pymdownx.superfences # 嵌套代码块
41+
- pymdownx.tabbed: # 选项卡
42+
alternate_style: true

0 commit comments

Comments
 (0)