From 0547164ee147a9a2eac979093ee70e38b1223f8e Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 28 Feb 2024 13:07:34 +0100 Subject: [PATCH 1/4] Move logo to static folder --- doc/conf.py | 2 +- doc/templates/{bootstrap => }/static/nav-logo.svg | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename doc/templates/{bootstrap => }/static/nav-logo.svg (100%) diff --git a/doc/conf.py b/doc/conf.py index b35fea0e89..bb0c918150 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -113,7 +113,7 @@ 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 diff --git a/doc/templates/bootstrap/static/nav-logo.svg b/doc/templates/static/nav-logo.svg similarity index 100% rename from doc/templates/bootstrap/static/nav-logo.svg rename to doc/templates/static/nav-logo.svg From b610aa77b75ad0685f1c422107ba3b34e8abde34 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 28 Feb 2024 13:43:25 +0100 Subject: [PATCH 2/4] Remove unnecessary imports/settings --- doc/conf.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index bb0c918150..272f270980 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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, @@ -108,11 +107,6 @@ # 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/static/nav-logo.svg" # Theme options are theme-specific and customize the look and feel of a theme From 39f33945087c66844c7c2ffa5202b5535ced5a7c Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 28 Feb 2024 13:46:28 +0100 Subject: [PATCH 3/4] Override template to show logo in mobile view --- doc/conf.py | 2 +- doc/templates/layout.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 doc/templates/layout.html diff --git a/doc/conf.py b/doc/conf.py index 272f270980..eead349e93 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,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' diff --git a/doc/templates/layout.html b/doc/templates/layout.html new file mode 100644 index 0000000000..3ac975f40b --- /dev/null +++ b/doc/templates/layout.html @@ -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) %} + + {% if not theme_logo_only %}{{ project }}{% endif %} + {%- if logo or logo_url %} + + {%- endif %} + +{% endblock %} \ No newline at end of file From 4423dec3c726ffc7ddd9c63876ab2d5e13743729 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 28 Feb 2024 13:56:53 +0100 Subject: [PATCH 4/4] Style logo same as in sidebar --- doc/_static/custom.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/_static/custom.css b/doc/_static/custom.css index b15770ab38..f95b07c2a3 100644 --- a/doc/_static/custom.css +++ b/doc/_static/custom.css @@ -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; }