Skip to content

Commit c434f6b

Browse files
committed
fix: mdbook deploy by removing deprecated fields and fixing config
- Remove deprecated 'multilingual' field from book.toml - Remove deprecated 'copy-fonts' field from book.toml - Fix git-repository-icon: fa-github -> fab-github - Fix workflow to use ./book (not ./book/html) - Disable mdbook-linkcheck (incompatible with mdbook 0.5.x) - Add ensure_mermaid_assets() to mdbook.sh to generate JS files before build
1 parent 780fd79 commit c434f6b

3 files changed

Lines changed: 22 additions & 29 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Upload artifact
3838
uses: actions/upload-pages-artifact@v3
3939
with:
40-
path: ./book/html
40+
path: ./book
4141

4242
deploy:
4343
environment:

book.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ command = "mdbook-mermaid"
1919
default-theme = "rust"
2020
preferred-dark-theme = "navy"
2121
git-repository-url = "https://github.com/coder/httpjail"
22-
git-repository-icon = "fa-github"
22+
git-repository-icon = "fab-github"
2323
edit-url-template = "https://github.com/coder/httpjail/edit/main/{path}"
2424
site-url = "https://coder.github.io/httpjail/"
2525
cname = ""
2626
mathjax-support = false
27-
copy-fonts = true
2827
additional-css = ["docs/custom.css"]
2928
additional-js = ["mermaid.min.js", "mermaid-init.js"]
3029
no-section-label = false
@@ -48,12 +47,9 @@ heading-split-level = 3
4847

4948
[output.html.redirect]
5049

51-
[output.linkcheck]
52-
# Optional: Only check internal links (faster builds)
53-
follow-web-links = false
54-
# Optional: Allow links outside book root
55-
traverse-parent-directories = false
56-
# Optional: Exclude patterns (regex)
57-
exclude = [ "^https://crates\\.io", "^https://docs\\.rs" ]
58-
# Optional: HTTP request configuration
59-
warning-policy = "warn"
50+
# Disabled: mdbook-linkcheck 0.7.7 is incompatible with mdbook 0.5.x
51+
# [output.linkcheck]
52+
# follow-web-links = false
53+
# traverse-parent-directories = false
54+
# exclude = [ "^https://crates\\.io", "^https://docs\\.rs" ]
55+
# warning-policy = "warn"

scripts/mdbook.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,30 +76,27 @@ ensure_mermaid_assets() {
7676
fi
7777
}
7878

79-
# Install mdbook-linkcheck if not present
80-
ensure_mdbook_linkcheck() {
81-
if command_exists mdbook-linkcheck; then
82-
log_info "mdbook-linkcheck is already installed ($(mdbook-linkcheck --version 2>&1 | head -1 || echo 'unknown version'))"
83-
return 0
84-
fi
85-
86-
log_warn "mdbook-linkcheck not found, installing..."
87-
88-
if command_exists cargo; then
89-
cargo install mdbook-linkcheck --locked
90-
else
91-
log_error "cargo not found. Please install Rust toolchain first: https://rustup.rs/"
92-
exit 1
93-
fi
94-
}
79+
# Disabled: mdbook-linkcheck 0.7.7 is incompatible with mdbook 0.5.x
80+
# ensure_mdbook_linkcheck() {
81+
# if command_exists mdbook-linkcheck; then
82+
# log_info "mdbook-linkcheck is already installed"
83+
# return 0
84+
# fi
85+
# log_warn "mdbook-linkcheck not found, installing..."
86+
# if command_exists cargo; then
87+
# cargo install mdbook-linkcheck --locked
88+
# else
89+
# log_error "cargo not found"
90+
# exit 1
91+
# fi
92+
# }
9593

9694
# Main installation check
9795
main() {
9896
log_info "Checking mdbook prerequisites..."
9997

10098
ensure_mdbook
10199
ensure_mdbook_mermaid
102-
ensure_mdbook_linkcheck
103100
ensure_mermaid_assets
104101

105102
log_info "All prerequisites satisfied"

0 commit comments

Comments
 (0)