new file mode 100644
@@ -0,0 +1,60 @@
+From 0983c3e3a298f5ec601084e4005152d7a1de4f49 Mon Sep 17 00:00:00 2001
+From: Antonin Godard <antonin.godard@bootlin.com>
+Date: Tue, 3 Feb 2026 17:03:09 +0100
+Subject: [PATCH] docs: adapt for custom switchers.js
+
+This is an adaptation of the patch in recent versions of the documentation to
+make the new switchers.js menu available in older versions of the BitBake
+documentation.
+
+Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
+---
+ doc/Makefile | 3 ++-
+ doc/bitbake.yaml.in | 1 +
+ doc/conf.py | 8 +++++++-
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+ create mode 100644 doc/bitbake.yaml.in
+
+diff --git a/doc/Makefile b/doc/Makefile
+index 4d721d30f3..0606181999 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -27,9 +27,10 @@ publish: Makefile html singlehtml
+ sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
+
+ clean:
+- @rm -rf $(BUILDDIR)
++ @rm -rf $(BUILDDIR) sphinx-static/switchers.js
+
+ # Catch-all target: route all unknown targets to Sphinx using the new
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+ %: Makefile
++ $(SOURCEDIR)/set_versions.py
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+diff --git a/doc/bitbake.yaml.in b/doc/bitbake.yaml.in
+new file mode 100644
+index 0000000000..4085582df6
+--- /dev/null
++++ b/doc/bitbake.yaml.in
+@@ -0,0 +1 @@
++DOCCONF_VERSION : "dev"
+diff --git a/doc/conf.py b/doc/conf.py
+index fc2ee08111..8ed72fb0fa 100644
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -16,8 +16,14 @@
+
+ import sys
+ import datetime
++import yaml
+
+-current_version = "dev"
++current_version = 'dev'
++
++with open("bitbake.yaml") as data:
++ buff = data.read()
++ subst_vars = yaml.safe_load(buff)
++ current_version = subst_vars["DOCCONF_VERSION"]
+
+ # String used in sidebar
+ version = 'Version: ' + current_version
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,71 @@
+From 850e7167e3189ed28dde6804d0f0bf0879db6eeb Mon Sep 17 00:00:00 2001
+From: Antonin Godard <antonin.godard@bootlin.com>
+Date: Tue, 3 Feb 2026 17:03:09 +0100
+Subject: [PATCH] docs: adapt for custom switchers.js
+
+This is an adaptation of the patch in recent versions of the documentation to
+make the new switchers.js menu available in older versions of the BitBake
+documentation.
+
+Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
+---
+ doc/Makefile | 3 ++-
+ doc/bitbake.yaml.in | 1 +
+ doc/conf.py | 10 +++++++++-
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+ create mode 100644 doc/bitbake.yaml.in
+
+diff --git a/doc/Makefile b/doc/Makefile
+index 996f01b7d5c..998ba52b8c5 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -27,9 +27,10 @@ publish: Makefile html singlehtml
+ sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
+
+ clean:
+- @rm -rf $(BUILDDIR)
++ @rm -rf $(BUILDDIR) sphinx-static/switchers.js
+
+ # Catch-all target: route all unknown targets to Sphinx using the new
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+ %: Makefile
++ $(SOURCEDIR)/set_versions.py
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+diff --git a/doc/bitbake.yaml.in b/doc/bitbake.yaml.in
+new file mode 100644
+index 00000000000..4085582df60
+--- /dev/null
++++ b/doc/bitbake.yaml.in
+@@ -0,0 +1 @@
++DOCCONF_VERSION : "dev"
+diff --git a/doc/conf.py b/doc/conf.py
+index bce386624e2..5b28808c590 100644
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -14,17 +14,25 @@
+ # import sys
+ # sys.path.insert(0, os.path.abspath('.'))
+
++import os
+ import sys
+ import datetime
++import yaml
+
+ from pathlib import Path
+
+-current_version = "dev"
++current_version = 'dev'
++
++with open("bitbake.yaml") as data:
++ buff = data.read()
++ subst_vars = yaml.safe_load(buff)
++ current_version = subst_vars["DOCCONF_VERSION"]
+
+ # String used in sidebar
+ version = 'Version: ' + current_version
+ if current_version == 'dev':
+ version = 'Version: Current Development'
++
+ # Version seen in documentation_options.js and hence in js switchers code
+ release = current_version
+
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+1.46
\ No newline at end of file
@@ -118,7 +118,13 @@ for branch in 1.46 $(git branch --remote --contains "$first_sphinx_commit" --for
git checkout $branch
git reset --hard
git clean -ffdx
- git checkout origin/master releases.rst
+
+ if [ -e "${scriptdir}/docs-build-patches/bitbake/${branch}" ]; then
+ echo Adding patch for $branch
+ git am -3 "${scriptdir}/docs-build-patches/bitbake/${branch}/"000*
+ fi
+
+ git checkout origin/master releases.rst sphinx-static/switchers.js.in set_versions.py
(
. $builddir/buildtools/environment-setup*
@@ -243,10 +249,6 @@ for branch in "$ypdocsbranch" dunfell $(git branch --remote --contains "$first_s
git clean -ffdx
done
-# Update bitbake switchers.js with the copy from master ypdocs
-cd $outputdir/bitbake
-find . -name switchers.js -exec cp $outputdir/current/_static/switchers.js {} \;
-
if [ "$PUBLISH" -ne 0 ]; then
cd $outputdir
rsync -irlp --checksum --ignore-times --delete . docs@docs.yoctoproject.org:docs/
Adapt scripts/run-docs-build to pick up the switchers.js.in and set_versions.py file from bitbake's master branch, like what is done for yocto-docs. Since this can't work on its own for older releases, create migration patches for older releases in order to actually include the previously checked out files in the build output. Most of the patch files are the same except for 2.16. Create symlinks to avoid duplication. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- IMPORTANT: this depends on https://lore.kernel.org/r/20260204-fix-switchers-js-v2-1-ea80107eff85@bootlin.com being merged on master. --- .../0001-docs-adapt-for-custom-switchers.js.patch | 60 ++++++++++++++++++ scripts/docs-build-patches/bitbake/1.48 | 1 + scripts/docs-build-patches/bitbake/1.50 | 1 + scripts/docs-build-patches/bitbake/1.52 | 1 + scripts/docs-build-patches/bitbake/2.0 | 1 + scripts/docs-build-patches/bitbake/2.10 | 1 + scripts/docs-build-patches/bitbake/2.12 | 1 + .../0001-docs-adapt-for-custom-switchers.js.patch | 71 ++++++++++++++++++++++ scripts/docs-build-patches/bitbake/2.2 | 1 + scripts/docs-build-patches/bitbake/2.4 | 1 + scripts/docs-build-patches/bitbake/2.6 | 1 + scripts/docs-build-patches/bitbake/2.8 | 1 + scripts/run-docs-build | 12 ++-- 13 files changed, 148 insertions(+), 5 deletions(-) --- base-commit: ec17abb0b2d759b800cefec4fcac61cee74dbefc change-id: 20260204-bitbake-custom-switchers-b3812e99e625