Skip to content

Commit 7f03252

Browse files
committed
Initial commit
1 parent 1735828 commit 7f03252

File tree

6 files changed

+132
-30
lines changed

6 files changed

+132
-30
lines changed

.github/email-blacklist.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*@qq.com
2+
*@foxmail.com
3+
*@126.com
4+
*@163.com
5+
*@sina.com
6+
MX-RECORD,mxbiz1.qq.com
7+
MX-RECORD,mx1.qiye.aliyun.com
8+
MX-RECORD,mx.ym.163.com
9+
MX-RECORD,mx.huaweicloud.com

.github/workflows/deploy.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ jobs:
2323
- run: |
2424
pip install -r requirements.txt
2525
mkdocs build
26+
mkdir sites
27+
mv site sites/clash
2628
env:
2729
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
2830
2931
- name: Deploy
3032
uses: peaceiris/actions-gh-pages@v3
3133
with:
3234
github_token: ${{ secrets.GITHUB_TOKEN }}
33-
publish_dir: site
34-
# cname: clash.watfaq.com
35+
publish_dir: sites
36+
cname: docs.watfaq.com
3537
force_orphan: true
3638
user_name: github-actions[bot]
3739
user_email: github-actions[bot]@users.noreply.github.com

.github/workflows/email-check.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Commit Email Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
issues: write
14+
steps:
15+
- name: Checkout PR branch
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Extract commit emails
21+
run: |
22+
BASE_SHA=${{ github.event.pull_request.base.sha }}
23+
HEAD_SHA=${{ github.event.pull_request.head.sha }}
24+
git log --format='%ae' $BASE_SHA..$HEAD_SHA | sort -u > commit-emails.txt
25+
26+
- uses: taiki-e/install-action@v2
27+
with:
28+
tool: check-commits-email
29+
30+
- name: Run validation
31+
id: check
32+
run: |
33+
check-commits-email \
34+
--rules .github/email-blacklist.txt \
35+
--emails commit-emails.txt \
36+
--output github >> $GITHUB_OUTPUT
37+
38+
- name: Find Comment
39+
uses: peter-evans/find-comment@v3
40+
id: find-comment
41+
with:
42+
issue-number: ${{ github.event.pull_request.number }}
43+
comment-author: 'github-actions[bot]'
44+
body-includes: Violation of email address detected
45+
46+
- name: Post comment
47+
if: steps.check.outputs.violations != ''
48+
uses: peter-evans/create-or-update-comment@v4
49+
with:
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
issue-number: ${{ github.event.pull_request.number }}
52+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
53+
edit-mode: replace
54+
body: |
55+
### ⚠️ Violation of email address detected
56+
The following email(s) match the blacklist rule:
57+
58+
${{ steps.check.outputs.violations }}
59+
60+
<details>
61+
62+
<summary>Correction steps</summary>
63+
64+
1. Modifying author information using interactive rebase
65+
```bash
66+
git rebase -i HEAD~${{ github.event.pull_request.commits }}
67+
# Mark the commit that needs to be modified as edit
68+
```
69+
70+
2. For each marked commit, execute:
71+
```bash
72+
git commit --amend --author="username <other-email.com>"
73+
git rebase --continue
74+
```
75+
76+
3. Force push update branch
77+
```bash
78+
git push --force-with-lease
79+
```
80+
81+
</details>
82+
83+
- name: Delete comment
84+
if: ${{ steps.find-comment.outputs.comment-id != '' && steps.check.outputs.violations == '' }}
85+
uses: detomarco/delete-comment@main
86+
with:
87+
token: ${{ secrets.GITHUB_TOKEN }}
88+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
89+

docs/index.md

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
hide:
3-
- navigation
43
- toc
4+
- navigation
55
---
66
# 👋Welcome to ClashRS User Manual
77

@@ -21,18 +21,3 @@ ClashRS is a network proxy software that you can use to control how you want to
2121
- ⚙️ Shadowsocks/Trojan/Vmess outbound support with different underlying trasports.
2222
- 🌍 Dynamic remote rule/proxy loader.
2323
- 🎵 Tracing with Jaeger
24-
25-
26-
27-
## Links
28-
29-
- Repository - https://github.com/Watfaq/clash-rs
30-
- Download - https://github.com/Watfaq/clash-rs/releases
31-
32-
## Get Started
33-
34-
We've put together some helpful guides for you to get setup with our product quickly and easily.
35-
36-
[⌨️Getting set up](quick-start/index.md)
37-
38-
[🔨Configuration](config/index.md)

docs/index.zh.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
hide:
3-
- navigation
43
- toc
4+
- navigation
55
---
6+
67
# 👋Welcome to ClashRS User Manual
78

89

@@ -33,6 +34,6 @@ ClashRS is a network proxy software that you can use to control how you want to
3334

3435
We've put together some helpful guides for you to get setup with our product quickly and easily.
3536

36-
[⌨️Getting set up](quick-start/index.md)
37+
[⌨️Getting set up](./quick-start/index.md)
3738

38-
[🔨Configuration](config/index.md)
39+
[🔨Configuration](../config/index.md)

mkdocs.yml

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
site_name: ClashRS User Mannual
22
docs_dir: docs
3-
site_url: https://clash.watfaq.com
3+
site_url: https://docs.watfaq.com/clash/
44
repo_url: https://github.com/Watfaq/clash-rs
5-
edit_uri: "https://github.com/Watfaq/docs/blob/master/docs/"
5+
edit_uri: https://github.com/Watfaq/docs/blob/master/docs/
66
repo_name: clash-rs
77

88
theme:
99
name: material
1010
features:
1111
- search.highlight
1212
- navigation.tracking
13-
- navigation.instant
13+
# - navigation.instant
1414
# - navigation.expand
1515
- navigation.path
1616
- navigation.indexes
@@ -21,7 +21,25 @@ theme:
2121
- content.action.edit
2222
- content.code.copy
2323
- content.code.select
24-
24+
palette:
25+
- media: "(prefers-color-scheme)"
26+
toggle:
27+
icon: material/link
28+
name: Switch to light mode
29+
- media: "(prefers-color-scheme: light)"
30+
scheme: default
31+
primary: indigo
32+
accent: indigo
33+
toggle:
34+
icon: material/toggle-switch
35+
name: Switch to dark mode
36+
- media: "(prefers-color-scheme: dark)"
37+
scheme: slate
38+
primary: black
39+
accent: indigo
40+
toggle:
41+
icon: material/toggle-switch-off
42+
name: Switch to system preference
2543
# https://facelessuser.github.io/pymdown-extensions/
2644
markdown_extensions:
2745
- pymdownx.superfences
@@ -37,8 +55,7 @@ markdown_extensions:
3755
- pymdownx.snippets
3856

3957
nav:
40-
- Welcome:
41-
- index.md
58+
- Welcome: index.md
4259
- Quick start:
4360
- quick-start/index.md
4461
- CLI: quick-start/cli.md
@@ -48,10 +65,8 @@ nav:
4865
- Full Example: config/full.md
4966

5067
plugins:
51-
- search
68+
# - search
5269
# - awesome-pages
53-
- minify:
54-
minify_html: true
5570
- i18n:
5671
docs_structure: suffix
5772
fallback_to_default: true
@@ -62,6 +77,7 @@ plugins:
6277
default: true
6378
locale: en
6479
name: English
80+
site_name: "ClashRS User Mannual"
6581
- build: true
6682
default: false
6783
locale: zh

0 commit comments

Comments
 (0)