Skip to content

Commit dfc569a

Browse files
committed
Wrap the versions menu under a theme config
In readthedocs.com/.org is not needed the usage of the bottom left versions menu, so we are making this a theme config to control it from outside. The default value is to add the menu (too keep backward compatibility).
1 parent 30b57e6 commit dfc569a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/configuring.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via
2525
'prev_next_buttons_location': 'bottom',
2626
'style_external_links': False,
2727
'vcs_pageview_mode': '',
28+
'versions_menu': True,
2829
# Toc options
2930
'collapse_navigation': False,
3031
'sticky_navigation': True,
@@ -49,6 +50,7 @@ Base options
4950
* ``vcs_pageview_mode`` String. Changes how to view files when using `display_github`, `display_gitlab`, etc.
5051
When using Github or Gitlab this can be: `blob` (default), `edit`, or `raw`,
5152
on Bitbucket, this can be either: `view` (default) or `edit`.
53+
* ``versions_menu`` Bool. Whether or not to show the bottom left menu listing the versions and links to VCS repository.
5254

5355
TOC Options
5456
~~~~~~~~~~~

sphinx_rtd_theme/theme.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ display_version = True
1616
prev_next_buttons_location = bottom
1717
style_external_links = False
1818
vcs_pageview_mode =
19+
versions_menu = True

sphinx_rtd_theme/versions.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<span class="fa fa-caret-down"></span>
88
</span>
99
<div class="rst-other-versions">
10+
{% if theme_versions_menu %}
1011
<dl>
1112
<dt>{{ _('Versions') }}</dt>
1213
{% for slug, url in versions %}
@@ -30,7 +31,9 @@
3031
</dl>
3132
<hr/>
3233
{% trans %}Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>.{% endtrans %}
33-
34+
{% else %}
35+
{# This content is injected by an AJAX call to readthedocs.org/readthedocs.com #}
36+
{% endif %}
3437
</div>
3538
</div>
3639
{% endif %}

0 commit comments

Comments
 (0)