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

@@ -24,7 +24,6 @@
{\noindent The full source code for the book is available at \\ {\noindent The full source code for the book is available at \\
\url{https://github.com/hendricius/the-sourdough-framework/} under MIT \url{https://github.com/hendricius/the-sourdough-framework/} under MIT
license. Do not hesitate to report mistakes or sug\-gestions for license. Do not hesitate to report mistakes or sug\-gestions for
improvements. A hardcover version of the book, featuring a much nicer improvements. A hardcover version of the book is also available. More information here:
design, is also available. More information here:
\url{https://www.breadco.de/hardcover-book}}\\[\baselineskip] \url{https://www.breadco.de/hardcover-book}}\\[\baselineskip]
} }

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

View File

@@ -166,20 +166,6 @@ class ModifyBuild
doc.to_html doc.to_html
end 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 # By default the menu is not made for mobile devices. This adds mobile
# capabilities to the menu # capabilities to the menu
def fix_menu(text) def fix_menu(text)
@@ -213,11 +199,17 @@ class ModifyBuild
def fix_cover_page(text) def fix_cover_page(text)
doc = build_doc(text) doc = build_doc(text)
body = doc.css("body")[0] body = doc.css("body")[0]
content = doc.css("body > .titlepage")[0] version = doc.css("body i")[0].text
menu = doc.css("body > .menu")[0] content = doc.css("body > .main-content")[0]
cover = content.css(".center")[0] menu = doc.css("body > nav")[0]
cover_html = cover.to_html content = %Q{
cover.inner_html = "<a href='Thehistoryofsourdough.html'>#{cover_html}</a>" <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}" body.inner_html = "#{menu} #{content}"
doc.to_html doc.to_html
end end