Skip to content

Commit

Permalink
fix(version): add a workaround for document ver
Browse files Browse the repository at this point in the history
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 <rs@ti.com>
  • Loading branch information
StaticRocket authored and cshilwant committed Dec 16, 2024
1 parent 5c4d7d3 commit 4fa6276
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _static/css/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@
.wy-nav-content {
max-width: 100% !important;
}

/* Version compatibility override */
.wy-side-nav-search>div.version {
margin-top: -.4045em;
margin-bottom: .809em;
font-weight: 400;
color: hsla(0, 0%, 100%, .3);
}
19 changes: 19 additions & 0 deletions _templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@
<script src="https://www.ti.com/assets/js/headerfooter/analytics.js" type="text/javascript" charset="utf-8"></script>
{{ super() }}
{% endblock %}
{%- block sidebartitle %}
{# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
{%- 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>
{%- set nav_version = version %}
{%- if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{%- endif %}
{%- include "searchbox.html" %}
{% endblock %}

0 comments on commit 4fa6276

Please sign in to comment.