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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,3 @@ TODO
====
* Update to font-awesome 4.0 and have it build from bower, not the copy/paste hack I have now.
* Separate some sass variables at the theme level so you can overwrite some basic colors.

4 changes: 3 additions & 1 deletion demo_docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options = {
# 'logo_only': True, # if we have a html_logo below, this shows /only/ the logo with no title text
}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ["../.."]
Expand Down
11 changes: 11 additions & 0 deletions sass/_theme_layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@
+font-smooth
&:hover
background: rgba(255,255,255,.1)
img.logo
display: block // display on its own line all the time
margin: 0 auto
height: auto // undo badge styling above
width: auto
border-radius: 0
max-width: 100% // shrink on mobile, if appropriate
background: rgba(0,0,0,0) // make hover background of parent show up properly
&.icon
img.logo
margin-top: 0.85em // space it away from the title text

.wy-nav .wy-menu-vertical
header
Expand Down
11 changes: 10 additions & 1 deletion sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,16 @@
{# SIDE NAV, TOGGLES ON MOBILE #}
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}</a>
{% if logo and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{% else %}
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{% endif %}
{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
{% endif %}
</a>
{% include "searchbox.html" %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sphinx_rtd_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ stylesheet = css/theme.css
[options]
typekit_id = hiw1hhg
analytics_id =
logo_only =