summaryrefslogtreecommitdiffstats
path: root/documentation/set_versions.py
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-04-20 17:04:43 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-20 17:25:33 +0100
commitee6718fe086cdb50b2acda9eab7a3f030478bed2 (patch)
treeb6eabd91c0c0acae87132715fe0681ef82d1e8a6 /documentation/set_versions.py
parent63e717738fb658432de63666e6d0d2790eaf5c88 (diff)
downloadpoky-ee6718fe086cdb50b2acda9eab7a3f030478bed2.tar.gz
docs: sphinx-static: switchers.js.in: fix broken switcher for branches
The switcher expects URL subpath to match the "release" used by sphinx to build the documentation. Branches, however, are put in a subpath after their name (e.g. dunfell) while sphinx sets the "release" to X.Y.999. This means the switcher cannot replace correctly the path to switch between releases/versions. Let set_versions.py inject the list of release names into the switchers.js.in file so it can check whether the subpath is one of the release names in which case it needs to be stripped. Cc: Quentin Schulz <foss+yocto@0leil.net> (From yocto-docs rev: 5ef3d129b8d0d8ae98a694103930988a46285525) Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/set_versions.py')
-rwxr-xr-xdocumentation/set_versions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index fc179ee195..261c1eeb37 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -203,6 +203,9 @@ versions = []
203with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w: 203with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w:
204 lines = r.readlines() 204 lines = r.readlines()
205 for line in lines: 205 for line in lines:
206 if "ALL_RELEASES_PLACEHOLDER" in line:
207 w.write(str(list(release_series.keys())))
208 continue
206 if "VERSIONS_PLACEHOLDER" in line: 209 if "VERSIONS_PLACEHOLDER" in line:
207 w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch]) 210 w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch])
208 for branch in activereleases + ([ourseries] if ourseries not in activereleases else []): 211 for branch in activereleases + ([ourseries] if ourseries not in activereleases else []):