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

Show NAV logo on mobile in the docs #2837

Merged
merged 4 commits into from
Feb 28, 2024
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
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 %}
Loading