Skip to content

Commit 9f6fc28

Browse files
committed
remove trailing .html
1 parent 65ba713 commit 9f6fc28

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

wrapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ python3 generate-summary.py
1414
# if arg is "build", just build the book
1515
if [ "$1" = "build" ]; then
1616
mdbook build
17+
18+
# wipe off the .html extension
19+
perl -i -p -e 's{href="index.html"}{href="."}g' book/toc.js
20+
perl -i -p -e 's{(href="[a-zA-Z0-9.][^"]+)\.html"}{$1"}g' book/toc.js
21+
find book/ -name *.html | xargs perl -i -p -e 's{href="index.html"}{href="."}g'
22+
find book/ -name *.html | xargs perl -i -p -e 's{(href="[a-zA-Z0-9.][^"]+)\.html"}{$1"}g'
23+
1724
else
1825
mdbook serve --hostname '0.0.0.0'
1926
fi

0 commit comments

Comments
 (0)