WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit f16ff5d

Browse files
committed
refactor: 更新依赖版本与覆盖样式写法,及更多规范化设置 (#260)
- 更新依赖到最新版 - 重写覆盖主题,使之不依赖于固定 material 版本 - 修改自定义 giscus 暗色主题至 transparent_dark - 增加 instant 加载与进度条 - 明确指定不在 nav 中的 markdown 文件(某历年卷源码) - 修改所有 HTML 目标的链接 - 更新 workflow,去掉 gh-pages 分支并添加手动触发 - 更新贡献指南与模板页面 - TuringPlugins 全部功能移至 hooks,弃用 TuringPlugins
1 parent adb3193 commit f16ff5d

File tree

53 files changed

+739
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+739
-452
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,50 @@
1-
name: deploy
1+
name: Build and Deploy to GitHub Pages
2+
23
on:
34
push:
45
branches:
56
- master
7+
workflow_dispatch:
8+
69
permissions:
7-
contents: write
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: 'deploy'
16+
cancel-in-progress: true
17+
818
jobs:
9-
deploy:
19+
build:
1020
runs-on: ubuntu-latest
1121
steps:
12-
- uses: actions/checkout@v3
22+
- name: Checkout
23+
uses: actions/checkout@v4
1324
with:
1425
fetch-depth: 0
15-
- uses: actions/setup-python@v4
26+
- name: Setup GitHub Pages
27+
uses: actions/configure-pages@v5
28+
- name: Setup Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.x'
32+
- name: Install dependencies
33+
run: pip install -r requirements.txt
34+
- name: Build site
35+
run: FULL=1 mkdocs build
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
1638
with:
17-
python-version: 3.x
18-
- run: pip install -r requirements.txt
19-
- name: Install TuringPlugins
20-
run: |
21-
git clone https://github.com/ZJU-Turing/TuringPlugins.git
22-
cd TuringPlugins
23-
pip install -e .
24-
cd ..
25-
- run: mkdocs gh-deploy --force
39+
path: ./site
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
site
3+
__pycache__

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ nocounter: true
1212
- 对应的 commit sha 值点击可以跳转到 GitHub 上对应的 commit 页面
1313
- commit message 中带有课程名的部分点击可以跳转到网站上对应页面
1414
- 该 commit 中有修改,但没有体现在 message 中的会将跳转链接列在二级列表中
15+
- 2025.7.20 之前的 commit 会跳转到[存档站](https://zju-turing.github.io/TuringCoursesGrave/)中对应页面
1516
- 从 pull request 而来的 commit 可以通过末尾的 `#pr` 跳转到对应的 pull request 页面
1617

1718
<style>

docs/contributing.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,11 @@
1111
$ git clone https://github.com/ZJU-Turing/TuringCourses.git
1212
$ cd TuringCourses
1313
```
14-
2. 安装 python 依赖(mkdocs 以及 material)
14+
2. 安装 python 依赖
1515
```shell
1616
$ pip install -r requirements.txt
1717
```
18-
3. 安装本文档专用插件
19-
```shell
20-
$ git clone https://github.com/ZJU-Turing/TuringPlugins.git
21-
$ cd TuringPlugins
22-
$ pip install -e .
23-
$ cd ..
24-
```
25-
4. 启动 mkdocs 本地服务
18+
3. 启动 mkdocs 本地服务
2619
```shell
2720
$ mkdocs serve
2821
```
@@ -44,14 +37,13 @@
4437
│ ├── general/ # 通识选修课
4538
│ ├── images/ # 仅用来保存网站图标
4639
│ ├── js/ # 本站用到的所有 js 脚本
47-
│ ├── major_basic/ # 专业基础课
48-
│ ├── major_elective/ # 专业选修课
49-
│ ├── major_mandatory/ # 专业必修课
40+
│ ├── major/ # 所有专业课程
5041
│ ├── math_phys/ # 数理基础课
5142
│ ├── others/ # 其他课程
5243
│ ├── political/ # 思政军体课
53-
│ ├── readings/ # 书评专区
44+
│ ├── readings/ # 书评专区(待建设)
5445
│ └── short_term/ # 短学期课程
46+
├── hooks/ # 本文档专用扩展功能(默认仅开启 evaluations)
5547
├── mkdocs.yml # mkdocs 站点设置
5648
├── overrides/ # mkdocs-material 个性主题设置
5749
└── requirements.txt # 本站构建所需全部 python 依赖
@@ -69,12 +61,12 @@
6961
- 尽量不要上传有版权的文件,例如课件等
7062
- 对于自己的笔记、复习提纲等材料:
7163
- 如果有自己的网站,推荐放在自己的网站并在此插入链接
72-
- 也可以将文件上传到对应课程文件夹中,并插入相对链接,例如[数分一](math_phys/math_analysis1/)页面中的历年卷
64+
- 也可以将文件上传到对应课程文件夹中,并插入相对链接,例如[数分一](math_phys/math_analysis1/index.md)页面中的历年卷
7365
- 尽量规范编写 markdown,避免出现格式错误
7466
- 如果你实在搞不定,不要担心,尽管上传,我们发现后会及时进行修改
7567

7668
!!! note
77-
针对还完全没有内容的空页面,我们提供了一个[模板](../template/),可以在模板的[源码](https://github.com/ZJU-Turing/TuringCourses/blob/master/docs/template.md?plain=1)基础上修改使用。
69+
针对还完全没有内容的空页面,我们提供了一个[模板](template.md),可以在模板的[源码](https://github.com/ZJU-Turing/TuringCourses/blob/master/docs/template.md?plain=1)基础上修改使用。
7870

7971
### 贡献方式
8072
#### Pull Request(推荐)

docs/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
6868
--md-code-bg-color: #fafafa;
6969
}
7070

71-
[data-md-color-scheme="slate"] {
71+
[data-md-color-scheme="slate"][data-md-color-primary="indigo"] {
7272
--md-default-bg-color: #161616;
7373
--md-default-bg-color--light: #161616;
7474
--md-default-bg-color--lighter: #161616;

docs/general/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
“上课学得好,不如选课选得好”,有些课程讲得好、有些课程讲得差;有些课程给分好、有些课程给分普遍偏低。所以说通识类课程的分数不一定和对课程内容掌握程度以及认真程度正相关。由于此类课程数量较多,所以采用分类、分课,评分、评价的方式来展示。分为三个子页面,供参考。
1414

15-
- [通识核心课](core/)
16-
- [通识选修课](elective/)
17-
- [其他选修课](others/)
15+
- [通识核心课](core.md)
16+
- [通识选修课](elective.md)
17+
- [其他选修课](others.md)

docs/js/scheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ window.toggleScheme = () => {
9090
body.setAttribute("data-md-color-scheme", scheme)
9191

9292
var frame = document.querySelector(".giscus-frame")
93-
var theme = scheme === "slate" ? "https://gcore.jsdelivr.net/gh/TonyCrane/note/docs/css/giscus.css" : "light"
93+
var theme = scheme === "slate" ? "transparent_dark" : "light"
9494
frame.contentWindow.postMessage(
9595
{ giscus: { setConfig: { theme } } },
9696
"https://giscus.app"

docs/major/advanced_data_structure/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
abbrs:
3+
- ads
24
grave: https://zju-turing.github.io/TuringCoursesGrave/major_basic/advanced_data_structure/
35
---
46

docs/major/compilers_principles/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
abbrs:
3+
- compiler
24
grave: https://zju-turing.github.io/TuringCoursesGrave/major_mandatory/compilers_principles/
35
---
46

docs/major/computer_system1/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
abbrs:
3+
- 计算机系统 I
4+
- 计算机系统Ⅰ
25
grave: https://zju-turing.github.io/TuringCoursesGrave/major_basic/computer_system1/
36
---
47

0 commit comments

Comments
 (0)