Skip to content

Commit c589aaa

Browse files
committed
docs: use 'release branch' as the current version in versions menu
Change the versions menu so that the name of the current version shown matches one of the items of available versions. The detailed version number is still shown in the upper left corner of the page.
1 parent 5224570 commit c589aaa

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

docs/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
66
<span class="rst-current-version" data-toggle="rst-current-version">
77
<span class="fa fa-book"> GitHub Pages</span>
8-
{{ version }}
8+
{{ versions_menu_this_version }}
99
<span class="fa fa-caret-down"></span>
1010
</span>
1111
<div class="rst-other-versions">

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@
8484

8585
# Versions to show in the version menu
8686
if getenv('VERSIONS_MENU'):
87-
html_context = {'versions_menu': True}
87+
html_context = {
88+
'versions_menu': True,
89+
'versions_menu_this_version': getenv('VERSIONS_MENU_THIS_VERSION', version)}
8890

8991
# -- General configuration ---------------------------------------------------
9092

docs/releases/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
# Versions to show in the version menu
2424
version = "all releases"
2525
if os.getenv('VERSIONS_MENU'):
26-
html_context = {'versions_menu': True}
26+
html_context = {
27+
'versions_menu': True,
28+
'versions_menu_this_version': version}
2729

2830

2931
# -- General configuration ---------------------------------------------------

scripts/build/update-gh-pages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ build_subdir=${build_subdir:-devel}
117117
echo "Updating site version subdir: '$build_subdir'"
118118
export SITE_BUILDDIR="$build_dir/$build_subdir"
119119
export VERSIONS_MENU=1
120+
export VERSIONS_MENU_THIS_VERSION=$build_subdir
120121

121122
make html
122123

0 commit comments

Comments
 (0)