diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index f287321f..a5f93b1a 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -310,8 +310,8 @@ do # We do this first because the tweaks below shouldn't apply to the single-page file se recompose-epub --xhtml --output "${workDir}"/single-page.xhtml --extra-css-file="${webRoot}/css/web.css" "${workDir}" - # Wrap book contents in a
tag - sed --in-place --regexp-extended "s|]*)>||; s||
|" "${workDir}"/single-page.xhtml + # Wrap book contents in a
tag (and extra
for styling reasons) + sed --in-place --regexp-extended "s|]*)>|
|; s||
|" "${workDir}"/single-page.xhtml # Add a navbar with a link back to the homepage sed --in-place --regexp-extended "s|]*)>|
|" "${workDir}"/single-page.xhtml @@ -342,8 +342,8 @@ do workTitle=$(grep --only-matching --extended-regexp "(.+?)" "${workDir}"/src/epub/content.opf | sed --regexp-extended "s/<[^>]+?>//g") 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" - # Wrap book contents in a <main> tag - 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><main\1>%; s%</body>%</main></body>%" + # Wrap book contents in a <main> tag (and extra <div> for styling reasons) + 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><main\1><div>%; s%</body>%</div></main></body>%" # Add the header 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=\"${bookUrl}\">Back to ebook</a></li><li><a href=\"${bookUrl}/text\">Table of contents</a></li></ul></nav></header>%" diff --git a/www/css/web.css b/www/css/web.css index b16674c9..b7e088be 100644 --- a/www/css/web.css +++ b/www/css/web.css @@ -10,10 +10,13 @@ body{ } main{ + flex-grow: 1; +} + +main > div{ margin: 8rem auto 3rem; max-width: 55ch; padding: 0 3rem; - flex-grow: 1; } body > header{ @@ -70,8 +73,8 @@ body > footer li{ max-width: 40%; } -body > main > section[epub|type~="titlepage"], -body > main > section[epub|type~="halftitlepage"]{ +body > main > div > section[epub|type~="titlepage"], +body > main > div > section[epub|type~="halftitlepage"]{ min-height: auto; } @@ -91,7 +94,7 @@ nav[epub|type~="toc"] ol{ } @media(max-width: 65ch){ - main{ + main > div{ padding: 0 2rem; }