GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
26.96k stars 3.85k forks source link

Add styles, don't work #1348

Closed dodospace closed 5 months ago

dodospace commented 8 years ago

book.json => Add styles, don't work like this { "styles": { "website": "styles/website.css", "ebook": "styles/ebook.css", "pdf": "styles/pdf.css", "mobi": "styles/mobi.css", "epub": "styles/epub.css" } }

SamyPesse commented 8 years ago

Do you have a link to the book source of book on GitBook.com?

noerw commented 8 years ago

We have the same issue, code is at https://github.com/sensebox/books/tree/custom_style/edu

Also I'd like to note that there is no documentation about this "styles": { ... } option

xldrkp commented 8 years ago

I have the same problem, but: When I compile the book locally, styles are included.

noerw commented 8 years ago

so i found out more.

the styles are only included for a toplevel book: for a multi language book, the actual language books have the style not included, while the language selection page does.

noerw commented 8 years ago

For multi language books, the style currently (v3.0.x - 3.2.x) needs to be placed within each language book, eg

de/styles/website.css
en/styles/website.css

A definition of the styles can be overidden by a separate book.json in each language book, but the defaults work as well.

We ended up symlinking the styles to a toplevel directory (ln -s ../../styles), to avoid the duplication of the files. However this breaks cross platform compatibility.

styles/website.css
edu/de/styles/ -> ../../styles/
home/en/styles/ -> ../../styles/
...

Would be great to have this fixed, so the style assets would be placed in the top level "main" book

daniele-orlando commented 6 years ago

Same here. GitBook 3.2.3