docs: build de 8429dfd7e1
This commit is contained in:
parent
5c8905ab13
commit
ac2e7cc8fc
73 changed files with 104 additions and 2 deletions
16
main/_static/version-switcher.js
Normal file
16
main/_static/version-switcher.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(() => {
|
||||
const versionRoot = new URL(document.documentElement.dataset.content_root, window.location.href);
|
||||
const switcherUrl = new URL(DOCUMENTATION_OPTIONS.theme_switcher_json_url, versionRoot);
|
||||
|
||||
const resolveLinks = (root) => {
|
||||
root.querySelectorAll(".version-switcher__menu a[href]").forEach((anchor) => {
|
||||
anchor.href = new URL(anchor.getAttribute("href"), switcherUrl).href;
|
||||
});
|
||||
};
|
||||
|
||||
resolveLinks(document);
|
||||
new MutationObserver(() => resolveLinks(document)).observe(document.documentElement, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue