Add configurable version display to nav header

This adds a subtle version display to the nav header. It will pull this
information from conf.py `version` if it exists, or if on RTD, `current_version`
from the conf additional context. If neither exists, or the `display_version`
option is false, the block will not display.
This commit is contained in:
Anthony Johnson 2015-07-17 16:41:52 -07:00
parent 6277c21110
commit 5e7d604290
6 changed files with 23 additions and 4 deletions

View File

@ -58,9 +58,9 @@ copyright = u'2013, Dave Snider'
# built documents.
#
# The short X.Y version.
version = '1'
version = '0.1.9'
# The full version, including alpha/beta/rc tags.
release = '1'
release = '0.1.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -205,6 +205,12 @@
&.icon
img.logo
margin-top: 0.85em // space it away from the title text
> div.version
margin-top: -1 * ($gutter / 4)
margin-bottom: $gutter / 2
font-weight: normal
color: rgba(255,255,255,.3)
.wy-nav .wy-menu-vertical
header

View File

@ -100,6 +100,18 @@
{% endif %}
</a>
{% if theme_display_version %}
{%- set nav_version = version %}
{% if READTHEDOCS and current_version %}
{%- set nav_version = current_version %}
{% endif %}
{% if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{% endif %}
{% endif %}
{% include "searchbox.html" %}
{% endblock %}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,3 +8,4 @@ analytics_id =
sticky_navigation = False
logo_only =
collapse_navigation = False
display_version = True