diff options
author | Antonin Godard <antonin.godard@bootlin.com> | 2024-11-06 08:48:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-12 11:09:51 +0000 |
commit | a0f93fed3a5c491e64c6b491b6d96435483012f0 (patch) | |
tree | df739bba361878f219c8f7b88e6c6b52b22d7ba9 /documentation/sphinx-static | |
parent | b5cb33f1f4fbd9896cd6b5e53ac81efb7b41d150 (diff) | |
download | poky-a0f93fed3a5c491e64c6b491b6d96435483012f0.tar.gz |
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: 13caec1386708d8609dff5f42956d2329a074f37)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/sphinx-static')
-rw-r--r-- | documentation/sphinx-static/switchers.js.in | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in index 8c016859bc..b1c0812b53 100644 --- a/documentation/sphinx-static/switchers.js.in +++ b/documentation/sphinx-static/switchers.js.in | |||
@@ -133,7 +133,13 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b | |||
133 | 133 | ||
134 | function get_docroot_url() { | 134 | function get_docroot_url() { |
135 | var url = window.location.href; | 135 | var url = window.location.href; |
136 | // Try to get the variable from documentation_options.js | ||
136 | var root = DOCUMENTATION_OPTIONS.URL_ROOT; | 137 | var root = DOCUMENTATION_OPTIONS.URL_ROOT; |
138 | if (root == null) { | ||
139 | // In recent versions of Sphinx, URL_ROOT was removed from | ||
140 | // documentation_options.js, so get it like searchtools.js does. | ||
141 | root = document.documentElement.dataset.content_root; | ||
142 | } | ||
137 | 143 | ||
138 | var urlarray = url.split('/'); | 144 | var urlarray = url.split('/'); |
139 | // Trim off anything after '/' | 145 | // Trim off anything after '/' |