Fix cover page website (#176)

* Fix cover page website issues

* Adjust cover page text

* Remove unneeded code
This commit is contained in:
Hendrik Kleinwaechter
2023-08-16 14:32:26 +02:00
committed by GitHub
parent 24633607d7
commit 939c6d9648
4 changed files with 12 additions and 21 deletions

View File

@@ -166,20 +166,6 @@ class ModifyBuild
doc.to_html
end
# The cover page should have some additional content and allow the user to
# click the book cover in order to start reading.
def fix_cover_page(text)
doc = build_doc(text)
body = doc.css("body")[0]
content = doc.css("body > .titlepage")[0]
menu = doc.css("body > .menu")[0]
cover = content.css(".center")[0]
cover_html = cover.to_html
cover.inner_html = "<a href='Thehistoryofsourdough.html'>#{cover_html}</a>"
body.inner_html = "#{menu} #{content}"
doc.to_html
end
# By default the menu is not made for mobile devices. This adds mobile
# capabilities to the menu
def fix_menu(text)
@@ -213,11 +199,17 @@ class ModifyBuild
def fix_cover_page(text)
doc = build_doc(text)
body = doc.css("body")[0]
content = doc.css("body > .titlepage")[0]
menu = doc.css("body > .menu")[0]
cover = content.css(".center")[0]
cover_html = cover.to_html
cover.inner_html = "<a href='Thehistoryofsourdough.html'>#{cover_html}</a>"
version = doc.css("body i")[0].text
content = doc.css("body > .main-content")[0]
menu = doc.css("body > nav")[0]
content = %Q{
<main class="titlepage">
<a href="Thehistoryofsourdough.html">
<img src="cover-page.jpg" />
<div class="version"><p>#{version}</p></div>
</a>
</main>
}
body.inner_html = "#{menu} #{content}"
doc.to_html
end