commit 7ef626ef85af398e04be86813ae85ed0a7ab9163 parent bae6d037715910e07d8c64c404878f4602b36462 Author: Suzanne Soy <jsmaniac.github@suzanne.soy> Date: Fri, 30 Jul 2021 20:58:20 +0100 Copy index.html one directory up, don't rewrite URLs to the non-versioned docs. Diffstat:
| M | .github/workflows/ci.yml | | | 6 | +++--- |
| M | fixlinks.sh | | | 8 | ++++++++ |
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml @@ -128,9 +128,9 @@ jobs: - name: Patch docs run: | ./fixlinks.sh - find doc -name '*.html' -type f -print0 | xargs -0 ls -ld - find doc -name '*.html' -type f -print0 | xargs -0 sed -i -e 's|https://download\.racket-lang\.org/docs/6\.9/html/|https://docs.racket-lang.org/|g' - find doc -name '*.html' -type f -print0 | xargs -0 ls -ld + #find doc -name '*.html' -type f -print0 | xargs -0 ls -ld + #find doc -name '*.html' -type f -print0 | xargs -0 sed -i -e 's|https://download\.racket-lang\.org/docs/6\.9/html/|https://docs.racket-lang.org/|g' + #find doc -name '*.html' -type f -print0 | xargs -0 ls -ld - name: Render MathJax offline run: | # Install nvm and node: diff --git a/fixlinks.sh b/fixlinks.sh @@ -26,3 +26,11 @@ sed -i -e 's~XD~%~g' doc/phc-thesis/index.html sed -i -e 's~XC~~g' doc/phc-thesis/index.html sed -i -e 's~XB~Y~g' doc/phc-thesis/index.html sed -i -e 's~XA~X~g' doc/phc-thesis/index.html + +# Transform 'href="index.html#…' to 'href="#…' so that links within the page don't cause a reload if the URL was …/phc-thesis/ vs. …/phc-thesis/index.html +sed -i -e 's/href="index.html#/href="#/g' doc/phc-thesis/index.html + +cp doc/phc-thesis/index.html doc/index.html +sed -i -e 's~"../pdf/~"pdf/~' doc/index.html +sed -i -e 's~"../phc-thesis-/~"phc-thesis-/~' doc/index.html +sed -i -e '1i<!-- This file is a copy of ../index.html with the relative URLs adjusted, it is kept here so that the old URL …/phc-theis/index.html keeps working but the new URL …/index.html should be used. -->' doc/phc-thesis/index.html