From d6ea6855dfcfdc3f4206cbe1f6f3301f35b8076b Mon Sep 17 00:00:00 2001 From: Robin Whittleton Date: Tue, 27 Jul 2021 22:06:48 +0200 Subject: [PATCH] Make the link to the ToC absolute instead of relative --- scripts/deploy-ebook-to-www | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index 0fd55603..c350be75 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -320,7 +320,8 @@ do find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s||<title>${workTitle} - |g" # Add the nav to each page - find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended 's/<body(.*?)>/<body\1><header><nav><ul><li><a href="\/">Standard Ebooks<\/a><\/li><li><a href="\.">Table of contents<\/a><\/li><\/ul><\/nav><\/header>/' + bookUrl=$(grep --only-matching --extended-regexp "<dc:identifier id=\"uid\">.+?</dc:identifier>" "${workDir}"/src/epub/content.opf | sed --regexp-extended "s/.*?url:(.*?)<.*/\1/g") + find "${workDir}"/src/epub \( -type d -name .git -prune \) -o -type f -name "*.xhtml" -print0 | xargs -0 sed --in-place --regexp-extended "s%<body(.*?)>%<body\1><header><nav><ul><li><a href=\"/\">Standard Ebooks</a></li><li><a href=\"${bookUrl}/text\">Table of contents</a></li></ul></nav></header>%" # Adjust sponsored links in the colophon sed --in-place 's|<p><a href="http|<p><a rel="nofollow" href="http|g' "${workDir}"/src/epub/text/colophon.xhtml