-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jupyter Book - Where is the theme defined / customized #718
Comments
hey! so, the theme is defined here: https://github.com/executablebooks/sphinx-book-theme jupyterbook is just using that theme straight-up if you'd like to add your own CSS, you can do so by following these instructions: https://jupyterbook.org/advanced/sphinx.html#custom-css-or-javascript However, that will just let you over-ride the CSS or javascript. You might be able to alter the pages to add a top-bar, but another way that you could try to do this is by creating your own theme that is a fork of the maybe that could be a start? |
thank you @choldgraf this is super helpful. i should have thought to look for a theme in this organization! so in that override
do you have an example of how i'd go about specifying a custom theme. all i really want to customize right now involves adding a top bar with navigation and a logo. you have nice typography on the site so i wont do much with the styles. would that look something like
And if the above is correct or on the right path, how would sphinx know to look for a theme in a repo somewhere? i think the page i want to manipulate is this template and potentially right here -- https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/layout.html#L38 this all looks very liquid like and familiar which is nice :) |
indeed that all sounds correct to me! and the template engine is called "Jinja", which is very similar to liquid in many ways (actually, I like it better because you can write functions in Python that you can then call from the template) just a note that some of this is diving into "advanced sphinx" territory :-) |
Hi @lwasser - were you able to accomplish what you were trying to do ? I think I'm trying to do something similar and add a navigation bar to the home page. Here is a visual example of what I'm trying to do: Essentially a styled "home page" for my Jupyterbook that contains the course syllabus (similar to this): with some sort of navigation to link to the actual "book" part of the site (existing side-bar is fine). If you notice, the examples above requires two separate sites that point to each other - NOT ideal! The home page was done with Hugo and the If someone has an example of styling just a single page, I'd love to see it - I'm sure I could hack something together with an example. Thanks for a great product! |
just a note that I believe jupyter books are self-contained HTML, which means that you could put a jupyter-book in a sub-directory of another site (e.g. a jekyll site or a hugo site). Then at least the URLs would be the same even if the layout of the page was different. |
That is a great point! I didn't think of that - thanks! I think I'll do that. |
ahh yes... i'm still interested in this. What i want is to add a top navigation bar. given in our case we have a lot of different types of content... it would be ideal to be able to add a header bar with a set of links back to our other courses and textbooks and site elements. it's a simple add but i'm realizing i may need to dig into sphinx a bit to get there. when a user can't get back to the main site you often lose them. |
would it be enough for me to allow you to add something like a |
I'm gonna close this one since it's not clear to me what's the actionable path forward, but if we need to resolve something else let's open another issue! |
hi @choldgraf don't hate me for being so slow to followup BUT if there were a |
@lwasser could you open that up as an issue in the |
absolutely @choldgraf ! |
Hi there @choldgraf ! As you know i've been thinking a lot about using JupyterBook for our textbooks on earthdatascience.org . I'd like to better understand where the theme files are in the book and how i could begin to modify them to skin the book to match our site.
SEO is important to use so we want multiple books in one place with a similar header / navigation top bar. And i have some ideas on surfacing content pages within the book as well for better seo!! But... to begin, how does the sphinx theme integrate into the book and where would i go to begin to skin a book?
iframes and embeds are not ideal because they are not as SEO friendly.
Many thanks for any suggestions!
The text was updated successfully, but these errors were encountered: