Skip to content

Commit e1450e5

Browse files
committed
fix(version): add a workaround for document ver
Add a workaround in the form of a css and template override for the upstream sphinx_rtd_theme bug that removed the version section from self hosted documentation. readthedocs/sphinx_rtd_theme#1624 Signed-off-by: Randolph Sapp <[email protected]>
1 parent 5db8d87 commit e1450e5

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

_static/css/theme_overrides.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@
1919
.wy-nav-content {
2020
max-width: 100% !important;
2121
}
22+
23+
/* Version compatibility override */
24+
.wy-side-nav-search>div.version {
25+
margin-top: -.4045em;
26+
margin-bottom: .809em;
27+
font-weight: 400;
28+
color: hsla(0, 0%, 100%, .3);
29+
}

_templates/layout.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,22 @@
33
<script src="https://www.ti.com/assets/js/headerfooter/analytics.js" type="text/javascript" charset="utf-8"></script>
44
{{ super() }}
55
{% endblock %}
6+
{%- block sidebartitle %}
7+
{# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
8+
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
9+
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
10+
{%- set _root_doc = root_doc|default(master_doc) %}
11+
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
12+
{% if not theme_logo_only %}{{ project }}{% endif %}
13+
{%- if logo or logo_url %}
14+
<img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
15+
{%- endif %}
16+
</a>
17+
{%- set nav_version = version %}
18+
{%- if nav_version %}
19+
<div class="version">
20+
{{ nav_version }}
21+
</div>
22+
{%- endif %}
23+
{%- include "searchbox.html" %}
24+
{% endblock %}

0 commit comments

Comments
 (0)