Skip to content
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

Respect html_logo, and throw it in the sidebar, fixes #24 #69

Merged
merged 4 commits into from
Mar 9, 2015

Conversation

DanielOaks
Copy link
Contributor

This basically fixes issue #24, and lets users' html_logo choice get put in the sidebar, below the little house logo and title. There's also an html_theme_options option, logo_only, which makes it so the house logo and title are completely removed, only showing the logo.

Examples, logo-only:
screen shot 2013-12-08 at 10 45 56 pm
screen shot 2013-12-08 at 10 46 24 pm

Examples, logo and text:
screen shot 2013-12-08 at 10 20 20 pm
screen shot 2013-12-08 at 10 21 32 pm

It also shrinks to fit how small the sidebar is. For example, if the sidebar is only 50px wide, the logo image will shrink to fit. It won't expand, though, which I think is acceptable (don't want pixellated images!)

@ericholscher
Copy link
Member

This looks awesome. Gonna let Dave take a look before merging it.

On Dec 8, 2013, at 7:25 AM, Daniel Oaks notifications@github.com wrote:

This basically fixes issue #24, and lets users' html_logo choice get put in the sidebar, underneath the little house logo and title (looks best there, I think). Not sure if we also wanna do something like hide the actual text title if there's a logo, too?

Examples:

It also shrinks to fit how large or small the sidebar is. For example, if the sidebar is only 50px wide, the logo image will shrink to fit.

You can merge this Pull Request by running

git pull https://github.com/DanielOaks/sphinx_rtd_theme html_logo
Or view, comment on, or merge it at:

#69

Commit Summary

Respect html_logo, and throw it in the sidebar, fixes #24
File Changes

M README.rst (1)
M sass/_theme_layout.sass (8)
M sphinx_rtd_theme/layout.html (7)
M sphinx_rtd_theme/static/css/theme.css (2)
Patch Links:

https://github.com/snide/sphinx_rtd_theme/pull/69.patch
https://github.com/snide/sphinx_rtd_theme/pull/69.diff

@ericholscher
Copy link
Member

Thoughts on this @snide -- looks great, and I see a lot of people who have logos in their main text to work around this.

@snide
Copy link
Collaborator

snide commented Dec 10, 2013

I'll check it out today. i did something similar earlier but removed it because I didn't like the way it worked in mobile and because ultimately, using a logo meant using other colors (not blue) and that should be configurable as well.

@DanielOaks
Copy link
Contributor Author

re: mobile, we could always have it hide the logo in mobile view, and just default back to the text link only, to compensate (looks a bit nicer, might stop a few issues – particularly with large logos. If all else fails, I could always look into ways to try and let other colours be configurable?

@snide
Copy link
Collaborator

snide commented Dec 10, 2013

I'll take care of it. It was something I was meaning to do anyway. Just gimme a day to mess around first. I'll try to get a merge in tomorrow. Thanks for the submission.

@DanielOaks
Copy link
Contributor Author

All good – thanks for the quick response!

@snide
Copy link
Collaborator

snide commented Dec 17, 2013

Ran through this a bit this morning. Gonna rewrite bits of it mostly so it's a little more friendly on the html side. I'll also try and do some styling if a logo exists to tone down the blue in that area. Sorry for the long wait on this, had a busy week with the holidays.

@DanielOaks
Copy link
Contributor Author

Fair enough, it's a little silly with how it currently generates the HTML anyways! All good, holidays are always busy, family and all. Thanks for taking the time to look over it!

@ehough ehough mentioned this pull request Jan 14, 2014
@zerocrates
Copy link

Any update on this?

I don't like to prod like this but it seemed like this was pretty much done and may have just been forgotten.

@swsnr
Copy link

swsnr commented Jun 5, 2014

I'd be interested in having a logo in the side bar as well…

@pdion891
Copy link

pdion891 commented Jun 6, 2014

+1

@DanielOaks
Copy link
Contributor Author

If stuff needs to be updated, lemme know and I'll merge master back in and
fix any possible conflicts/make sure it works!

On Friday, June 6, 2014, pdion891 notifications@github.com wrote:

+1


Reply to this email directly or view it on GitHub
#69 (comment).

@snide
Copy link
Collaborator

snide commented Jun 6, 2014

Unfortunately I'm launching my startup over the next month and I don't have the bandwidth for this right now. There are a couple problems that have kept me from merging it in that I think need to be addressed.

  1. Take 10 logos. 8 of them will look terrible on bright blue.
  2. On mobile it needs to be hidden.
  3. Tall vs. wide logos will look very different. Specifically square logos will look comicly large. Only way around this is to size it through javascript.

Putting this in as is would just jam at the problem. It needs more work. Specifically I'd love to see a way to manually build menus so that we can get rid of the whole dark background color on that menu in general. The only reason it exists is because without a hierarchy, that list is just a bunch of flat links. toc-depth won't work, because everyone lays out their folder structure completely different. It's a big enough problem that even RtD itself adds category headers to it's index.rst file to give large lists some order.

I'd be happy to work on a refresh of this theme in a month, but I'd like to see some way to manage the menu before I jump back in to do any serious work. If someone at least wants to address the top concerns beforehand, I'll take a look at it.

@DanielOaks
Copy link
Contributor Author

2: That's fine, it'll almost definitely look better hidden on mobile! I'll also show the project title name by default on there, regardless of whether it's usually hidden.

3: I'd just wrap it in another div with width: 100%, max-width: 2.5rem, max-height: 2.5rem or something around those lines. That should basically stop the logos from getting crazy big regardless of their actual size (will test this once I've got a dev environment up and running again).

I think I looked into issue 1 earlier, but that's a bit of a weird, integrated problem that takes some doing to resolve. Once I'm fairly free, I'll tackle those two issues though, try and get it a little closer and think about menu/colour stuff.

Thanks for the direction @snide, and good luck with the startup!

@aviau
Copy link

aviau commented Jul 2, 2014

I would like to see this working too. Hopefully you didn't give up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants