Skip to content

Commit 5d278c7

Browse files
authored
feat: MkDocs config improvements (#37)
* chore: add site/ to .gitignore * feat: add instant prefetch and progress bar navigation * feat: add syntax highlighting for code blocks Add pymdownx.highlight with anchor line numbers and pymdownx.inlinehilite for inline code highlighting. * fix: use standard permalink for table of contents * feat: add mkdocs-minify-plugin for smaller output Minifies HTML, JS, and CSS in built output for faster page loads. Moves search plugin before glightbox for correct load order. * ci: enable strict mode for mkdocs build --------- Co-authored-by: bakerboy448 <bakerboy448@users.noreply.github.com>
1 parent ab1433a commit 5d278c7

5 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
${{ runner.os }}-pip-
2727
- run: |
2828
python3 -m pip install -r requirements.txt
29-
mkdocs build
29+
mkdocs build --strict

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: python3 -m pip install -r ./requirements.txt
4141

4242
- name: Build Docs
43-
run: mkdocs build
43+
run: mkdocs build --strict
4444

4545
- name: Deploy
4646
uses: peaceiris/actions-gh-pages@v4

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.venv
2+
site/

‎mkdocs.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ theme:
107107
- navigation.top
108108
- navigation.tracking
109109
- navigation.instant
110+
- navigation.instant.prefetch
111+
- navigation.instant.progress
110112
- toc.follow
111113
- search.suggest
112114
- search.highlight
@@ -130,6 +132,7 @@ extra_css:
130132
- stylesheets/github-permalink-style.css
131133

132134
plugins:
135+
- search
133136
- glightbox:
134137
touchNavigation: true
135138
loop: false
@@ -140,7 +143,12 @@ plugins:
140143
draggable: true
141144
auto_caption: false
142145
caption_position: bottom
143-
- search
146+
- minify:
147+
minify_html: true
148+
minify_js: true
149+
minify_css: true
150+
htmlmin_opts:
151+
remove_comments: true
144152

145153
markdown_extensions:
146154
- attr_list
@@ -150,10 +158,13 @@ markdown_extensions:
150158
- admonition
151159
- pymdownx.details
152160
- pymdownx.superfences
161+
- pymdownx.highlight:
162+
anchor_linenums: true
163+
- pymdownx.inlinehilite
153164
- tables
154165
- pymdownx.tabbed:
155166
alternate_style: true
156167
- md_in_html
157168
- toc:
158169
toc_depth: 4
159-
permalink: ''
170+
permalink: true

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ mkdocs~=1.6.0
22
mkdocs-material~=9.7.1
33
mkdocs-material-extensions~=1.3.0
44
mkdocs-glightbox~=0.5.0
5+
mkdocs-minify-plugin~=0.8.0

0 commit comments

Comments
 (0)