Skip to content

Commit f8caca0

Browse files
committed
Fix version text selection
Also horizontally center the logo on Firefox too
1 parent 9e2a2b1 commit f8caca0

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

docs/source/_static/hackrtd.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pre {
5858
.wy-side-nav-search > a {
5959
display: flex;
6060
align-items: center;
61-
justify-self: center;
61+
margin: auto;
62+
width: max-content;
6263
}
6364

6465
.wy-side-nav-search > a img.logo {

docs/source/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a class="logo" href="{{ pathto(root_doc) }}">
1313
<img class="logo" src="{{ logo_url }}" />
1414
{%- set nav_version = version %}
15-
{% if READTHEDOCS and current_version %}
15+
{% if current_version %}
1616
{%- set nav_version = current_version %}
1717
{% endif %}
1818
{# don't show the version on RTD if it's the default #}

docs/source/conf.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,7 @@ def setup(app: Sphinx) -> None:
180180
app.connect("source-read", on_read_source)
181181

182182

183-
# Our docs use the READTHEDOCS variable, so copied from:
184-
# https://about.readthedocs.com/blog/2024/07/addons-by-default/
185-
if os.environ.get("READTHEDOCS", "") == "True":
186-
if "html_context" not in globals():
187-
html_context = {}
188-
html_context["READTHEDOCS"] = True
183+
html_context = {"current_version": os.environ.get("READTHEDOCS_VERSION_NAME")}
189184

190185
# -- General configuration ------------------------------------------------
191186

0 commit comments

Comments
 (0)