From cecff57b218c837a43656f234c91773d02f748a8 Mon Sep 17 00:00:00 2001 From: TonyCrane Date: Mon, 25 Sep 2023 10:55:03 +0800 Subject: [PATCH 1/3] workflow: add GitHub Action to build website --- .github/workflows/deploy.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8d206d0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,20 @@ +name: deploy + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: pip install mkdocs-material mkdocs-heti-plugin + - run: mkdocs gh-deploy --force \ No newline at end of file From 083f4bca55c1a877bae9011a747dc22181f006ba Mon Sep 17 00:00:00 2001 From: TonyCrane Date: Mon, 25 Sep 2023 11:09:41 +0800 Subject: [PATCH 2/3] chore: clean & update config file --- mkdocs.yml | 91 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 99bf841..a54024d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,12 +2,36 @@ site_name: 竺院辅学计划站点 site_url: https://ckc-agc.pages.zjusct.io/study-assist/ repo_url: https://github.com/ckc-agc/study-assist repo_name: 竺院辅学计划站点 -edit_uri: "-/edit/main/docs/" +edit_uri: tree/master/docs site_description: 竺院辅学计划站点 site_author: 竺可桢学院学业指导中心 +nav: + - 首页: index.md + - 微积分: + - calculus/index.md + - 数学分析: + - analysis/index.md + - 历年卷整理: analysis/exam.md + - 2023 年辅学资料: analysis/2023/index.md + - 线性代数: + - algebra/index.md + - 程设: + - programming/index.md + - FAQ: programming/faq.md + - 历年卷: + - programming/exam/index.md + - C 小历年卷常见问题总结: programming/exam/fp.md + - C 大历年卷常见问题总结: programming/exam/lcp.md + - 2023 年辅学资料: programming/2023/index.md + - 普通化学: + - chemistry/index.md + theme: name: material + icon: + repo: fontawesome/brands/github + edit: material/pencil features: - search.highlight - navigation.instant @@ -18,6 +42,7 @@ theme: - header.autohide - content.code.copy - content.code.annotate + - content.action.edit palette: # Palette toggle for light mode - media: "(prefers-color-scheme: light)" @@ -35,41 +60,43 @@ theme: markdown_extensions: # Python Markdown + - toc: + permalink: true + toc_depth: 2 - abbr - - admonition - - attr_list - def_list + - attr_list - footnotes - md_in_html - - toc: - permalink: true - toc_depth: 2 + - admonition + - sane_lists # Python Markdown Extensions - - pymdownx.arithmatex: - generic: true + - pymdownx.keys + - pymdownx.mark + - pymdownx.tilde - pymdownx.caret - pymdownx.details - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.highlight - pymdownx.inlinehilite - - pymdownx.keys - - pymdownx.mark - pymdownx.smartsymbols - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.tabbed: alternate_style: true - pymdownx.tasklist: custom_checkbox: true - - pymdownx.tilde - pymdownx.snippets: auto_append: - includes/abbreviations.md + - pymdownx.arithmatex: + generic: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + extra_javascript: - javascripts/mathjax.js - https://polyfill.io/v3/polyfill.min.js?features=es6 @@ -77,25 +104,7 @@ extra_javascript: plugins: - search - - -nav: - - 首页: index.md - - 微积分: - - calculus/index.md - - 数学分析: - - analysis/index.md - - 历年卷整理: analysis/exam.md - - 2023 年辅学资料: analysis/2023/index.md - - 线性代数: - - algebra/index.md - - 程设: - - programming/index.md - - FAQ: programming/faq.md - - 历年卷: - - programming/exam/index.md - - C 小历年卷常见问题总结: programming/exam/fp.md - - C 大历年卷常见问题总结: programming/exam/lcp.md - - 2023 年辅学资料: programming/2023/index.md - - 普通化学: - - chemistry/index.md \ No newline at end of file + - heti: + extra_skipped_class: + - arithmatex + disable_serve: false From ea02cb5b705d59df2e3e95fe9850afe878091f98 Mon Sep 17 00:00:00 2001 From: TonyCrane Date: Mon, 25 Sep 2023 11:12:06 +0800 Subject: [PATCH 3/3] style: add extra css to improve style --- docs/stylesheets/custom.css | 46 +++++++++++++++++++++++++++++++++++++ mkdocs.yml | 3 +++ 2 files changed, 49 insertions(+) create mode 100644 docs/stylesheets/custom.css diff --git a/docs/stylesheets/custom.css b/docs/stylesheets/custom.css new file mode 100644 index 0000000..7c30dd3 --- /dev/null +++ b/docs/stylesheets/custom.css @@ -0,0 +1,46 @@ +h1 { + counter-reset: h2; +} +h2 { + counter-reset: h3; +} +h3 { + counter-reset: h4; +} +h4 { + counter-reset: h5; +} +h5 { + counter-reset: h6; +} +h2:before { + counter-increment: h2; + content: counter(h2); + margin-right: 0.8rem; +} +h3:before { + counter-increment: h3; + content: counter(h2) "." counter(h3); + margin-right: 0.8rem; +} +h4:before { + counter-increment: h4; + content: counter(h2) "." counter(h3) "." counter(h4); + margin-right: 0.8rem; +} +h5:before { + counter-increment: h5; + content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5); + margin-right: 0.8rem; +} +h6:before { + counter-increment: h6; + content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6); + margin-right: 0.8rem; +} +.md-typeset h1, .md-typeset h2 { + font-weight: 600; +} +.md-typeset h3 { + font-weight: 500; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index a54024d..21f5040 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -102,6 +102,9 @@ extra_javascript: - https://polyfill.io/v3/polyfill.min.js?features=es6 - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js +extra_css: + - stylesheets/custom.css + plugins: - search - heti: