From 3947a5f18b8d68c7946a9365d36cb760d0d51514 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Wed, 20 Apr 2022 17:04:43 +0200 Subject: 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 (From yocto-docs rev: 5ef3d129b8d0d8ae98a694103930988a46285525) Signed-off-by: Quentin Schulz Signed-off-by: Richard Purdie --- documentation/set_versions.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'documentation/set_versions.py') 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 = [] with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w: lines = r.readlines() for line in lines: + if "ALL_RELEASES_PLACEHOLDER" in line: + w.write(str(list(release_series.keys()))) + continue if "VERSIONS_PLACEHOLDER" in line: w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch]) for branch in activereleases + ([ourseries] if ourseries not in activereleases else []): -- cgit v1.2.3-54-g00ecf