mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
sphinx-static/switchers.js.in: do not refer to URL_ROOT anymore
This variable was removed from the Sphinx-generated documentation_options.js, thus breaking the current implementation of our switchers.js. Like searchtools.js, which is also generated by Sphinx, use document.documentElement.dataset.content_root as a replacement. To be backwards-compatible to get one or the other. (From yocto-docs rev: 1771d1b174b42ae9de5b46898a805bee7e10c076) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> (cherry picked from commit 2849690abf94872e259e712128e90413f3b9a2f2) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
4a66fa862b
commit
dfb27c0b97
@@ -133,7 +133,13 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
|
|||||||
|
|
||||||
function get_docroot_url() {
|
function get_docroot_url() {
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
|
// Try to get the variable from documentation_options.js
|
||||||
var root = DOCUMENTATION_OPTIONS.URL_ROOT;
|
var root = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
|
if (root == null) {
|
||||||
|
// In recent versions of Sphinx, URL_ROOT was removed from
|
||||||
|
// documentation_options.js, so get it like searchtools.js does.
|
||||||
|
root = document.documentElement.dataset.content_root;
|
||||||
|
}
|
||||||
|
|
||||||
var urlarray = url.split('/');
|
var urlarray = url.split('/');
|
||||||
// Trim off anything after '/'
|
// Trim off anything after '/'
|
||||||
|
|||||||
Reference in New Issue
Block a user