Skip to content

Commit

Permalink
Merge pull request #2837 from johannaengland/docs/logo-on-mobile
Browse files Browse the repository at this point in the history
Show NAV logo on mobile in the docs
  • Loading branch information
johannaengland authored Feb 28, 2024
2 parents 0c15d1a + 4423dec commit cbdf13f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
10 changes: 10 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
a, a:hover, a:focus, a:visited, .alert a, .alert .alert-link {color: #1f74ad;}
.wy-menu a:visited, .wy-menu-vertical a:visited, .wy-menu a:hover, .wy-menu-vertical a:hover { color: #d9d9d9; }

.wy-nav-top>a img.logo {
display:block;
margin:0 auto;
height:auto;
width:auto;
border-radius:0;
max-width:100%;
background:transparent
}

pre {
background: #ecf0f1;
}
Expand Down
10 changes: 2 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sphinx_rtd_theme
import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -39,7 +38,7 @@
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ['templates']

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down Expand Up @@ -108,12 +107,7 @@
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [
os.path.join(os.path.abspath(os.path.dirname(__file__)), "templates")
]

html_logo = "templates/bootstrap/static/nav-logo.svg"
html_logo = "templates/static/nav-logo.svg"

# 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
Expand Down
11 changes: 11 additions & 0 deletions doc/templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "!layout.html" %}
{% block mobile_nav %}
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
{%- set _root_doc = root_doc|default(master_doc) %}
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
{% if not theme_logo_only %}{{ project }}{% endif %}
{%- if logo or logo_url %}
<img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
{%- endif %}
</a>
{% endblock %}
File renamed without changes

0 comments on commit cbdf13f

Please sign in to comment.