summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'documentation')
-rwxr-xr-xdocumentation/set_versions.py3
-rw-r--r--documentation/sphinx-static/switchers.js.in12
2 files changed, 15 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 []):
diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in
index 7eb0c2ff34..1e523a188f 100644
--- a/documentation/sphinx-static/switchers.js.in
+++ b/documentation/sphinx-static/switchers.js.in
@@ -9,6 +9,10 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
9(function() { 9(function() {
10 'use strict'; 10 'use strict';
11 11
12 var all_releases =
13 ALL_RELEASES_PLACEHOLDER
14 ;
15
12 var switcher_versions = { 16 var switcher_versions = {
13 VERSIONS_PLACEHOLDER 17 VERSIONS_PLACEHOLDER
14 }; 18 };
@@ -155,6 +159,14 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
155 var new_url = docroot + new_versionpath + url.replace(docroot, ""); 159 var new_url = docroot + new_versionpath + url.replace(docroot, "");
156 var fallback_url = docroot + new_versionpath; 160 var fallback_url = docroot + new_versionpath;
157 } else { 161 } else {
162 // check for named releases (e.g. dunfell) in the subpath
163 $.each(all_releases, function(idx, release) {
164 if (docroot.endsWith('/' + release + '/')) {
165 current_version = release;
166 return false;
167 }
168 });
169
158 var new_url = url.replace('/' + current_version + '/', '/' + new_versionpath); 170 var new_url = url.replace('/' + current_version + '/', '/' + new_versionpath);
159 var fallback_url = new_url.replace(url.replace(docroot, ""), ""); 171 var fallback_url = new_url.replace(url.replace(docroot, ""), "");
160 } 172 }