Working on a modern epub3 theme

Hi,

I’ve used hugo on and off for a few years, and despite my subpaar skills been mostly happy with it, managing to get what I wanted done eventually. I found it excellent.

Now I am in need of creating an ebook from a .doc. There is this epub2 german theme, but that has lacked activity for years apparently, and it is not modern. Moreover, focusing on allowing any site to produce an epub, it ends up forcing very rigid content management choices, that don’t vibe with me. Like using leaf bundles for instance. Also, lots of things are hardcoded, whereas they should be done automatically. The only things the user should need to worry about, or pages and the cover, nothing else.

For now, I managed to reproduce the correct tree structure and each file is produced where it should. see here: GitHub - guyclaudeburger-collab/hugo-test
the biggest problem yet is that in epub3, as far as I understood, all content links (within the EPUB directory) are relative to that particular page. urls in EPUB/css/epub.css are like ../fonts/FreeSerif.otf for a font in /EPUB/fonts/.

I have relativeurls = true, but for the moment all links obtained from resources or pages start with “/EPUB/”. I am at my wits’ end :slightly_smiling_face:. I would appreciate if someone were to help.
Also, I would like to make the choice of cover image more general, but can’t find a sensible way to do it.

This idea was a waste of time. Since everything but two static files live under EPUB, we should flatten the content and asset structure and move them in that directory after build. Now it all works, with the exception of pictures, that won’t show, and I don’t understand why, I must be missing something in the code, the standard being very strict.

You have to look at this project: GitHub - weitblick/epub: An epub theme for the Static Site Generator HUGO. I used it few years ago, it was not easy and complete, but interesting for a single source publishing approach.

I used it as a base. But as you said, it was neither easy to use nor complete, and I aimed to make it much more transparent to the user. But there is only so far I can understand by comparing, since the standards are different (epub2 vs 3). But epubcheck will help out.
I brought it to completion and compliance. Now I’ll just have to iron out the css (though anyone should put his own sheet) and people will be able to use it as drop-in replacement.