Skip to content

Commit 0953746

Browse files
committed
Documentation: Added versions dropdown for released Tags
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@intel.com>
1 parent b86d031 commit 0953746

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

_templates/versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
33
<span class="rst-current-version" data-toggle="rst-current-version">
44
<span class="fa fa-book"> Versions</span>
5-
v: {{ version }}
5+
{{ version }}
66
<span class="fa fa-caret-down"></span>
77
</span>
88
<div class="rst-other-versions">

conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
version = "development"
5858

5959

60+
# Versions list with URLs using tags displayed in the lower left corner
61+
from git import Repo
62+
versions_to_exclude = set(['v1.0.0', 'v1.0.1','v1.1.0', 'v1.2.0', 'v1.2.1'])
63+
repo = Repo( search_parent_directories=True )
64+
github_repo = "/intel-technology-enabling-for-openshift/"
65+
release_versions = [("development", github_repo)]
66+
tags = reversed([tag.name for tag in repo.tags])
67+
release_versions.extend((str(tag), github_repo + tag) for tag in tags if str(tag) not in versions_to_exclude)
6068

6169
# -- General configuration ---------------------------------------------------
6270

@@ -68,6 +76,7 @@
6876
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
6977
# ones.
7078
extensions = ['myst_parser', 'sphinx_md', ]
79+
myst_heading_anchors = 5
7180
# myst_enable_extensions = [
7281
# "html_admonition",
7382
# ]
@@ -107,6 +116,7 @@
107116
'github_version': 'main/',
108117
'versions_menu': True,
109118
'version': version,
119+
'versions': release_versions,
110120
}
111121
html_css_files = [
112122
'custom.css',

0 commit comments

Comments
 (0)