standardebooks / web

The source code for the Standard Ebooks website.

Home Page:https://standardebooks.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Navigation options for web book text

robinwhittleton opened this issue · comments

Search engines are indexing the text and dropping people onto chapters or other parts of books. For example, I just ended up on https://standardebooks.org/ebooks/evelyn-underhill/practical-mysticism/text/halftitlepage

Do we want/need some sort of mini navigation to rescue people who can’t use the back button to proceed?

Maybe, but what the heck did you search for that it returned a top result of a page with only 8 words in it?

The nice thing about the current system is that we can just explode the epub and then expose it to the web. But if we added navigation then it would be a lot more post processing. Plus, if we add more elements then their styling could be messed up by the book CSS. For example what would happen to a top nav bar for a dedication, where children of <body> are centered using flex?

That specific example came up in a search for pages that mention "standardebooks" that were new in the last week. So not a normal query 😁 But still, I can easily imagine a user searching for a quote and ending up on one of our pages. It’s maybe not worth the hassle though.

If browsers supported <link rel="prev"/> / <link rel="next"/> I’d suggest adding them to the head, but that never happened.

Close if you feel like it’s not useful.

<link rel> would be a good addition I think. Another option is to use robots.txt to block indexing of the books themselves. Though I'm not sure if that's really what we want to do. If you want you can put together a PR to include <link rel> in the head in deploy-ebook-to-www. Relevant code starts around line 249.

Though it may be tough to do it in Bash since you'd have to parse the spine. Maybe it's time for deploy-ebook-to-www to be rewritten in Python. Though I don't have time for that for the foreseeable future!

I've thought about this a little more, and looked at some of the search results that lead people to SE, and it does look like Google et al are indexing at least the ToCs of a lot of the ebooks and sending people there for certain search queries. So maybe it does make sense to inject a header into the top of each exploded epub. Do you want to explore some possibilities for that?

Personally I think sticky headers are very annoying, but they do have some limited usefulness for small mobile devices. Maybe a small header with our name/logo that links to the homepage, and then a link to the ebook ToC? The header might be non-sticky for large screens but sticky for ipad size and below?

I looked more closely at our sectioning and since we require at least a child <section> for each <body> it might be feasible to inject a nav bar as a direct child of <body> without messing up the layout of the actual page, for uniquely formatted pages like dedications.

Sorry, spare time has been limited. Just a link back to the ToC sounds good. I’ll investigate what it would take for this.

I’ve got a first draft done, but to test properly I’m trying to update the Docker image to allow for deploy-ebook-to-www usage. I don’t fully understand though what’s happening at

sudo chown --recursive se:committers "${webRoot}/www/opds/"*
sudo chmod --recursive 664 "${webRoot}/www/opds/"*.xml
sudo chmod --recursive 664 "${webRoot}/www/opds/"*/*.xml
sudo chown --recursive se:committers "${webRoot}/www/rss/"*
sudo chmod --recursive 664 "${webRoot}/www/rss/"*.xml
sudo chmod 775 "${webRoot}/www/opds/subjects"

My understanding is that se:committers refers to an se user in a committers group, but we’re already setting up an se group earlier, and Ubuntu at least complains if a user is given the same name as a group. Any help appreciated!

On the server, there is an se user and a committers group. The se user is mostly for web site filesystem level permissions, it is not a "real" user. There is also an se group for managing the SE website. The committers group includes many real users like you and me, who are allowed to write to the repos themselves. It does not have anything to do with the actual website per se but is more for managing the actual ebook repos. Ubuntu should have no problem with this setup because that's how the live server is set up right now :)