diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-11 12:29:57 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-11 12:29:57 -0400 |
| commit | 39dffebf418cf0cfb3ac787d061170c7c54ca904 (patch) | |
| tree | e4b30441c4e9164874f689cf2fc52f0001378545 /docs/javascripts/version-selector.js | |
| parent | Add support for deploy-docs to work easily locally (diff) | |
| download | cli-39dffebf418cf0cfb3ac787d061170c7c54ca904.zip | |
Revert "Add support for versioned docs"
This reverts commit 3cd15cb2e3aecc4c2e1e553d9ac7e4a7a67c46b1.
Diffstat (limited to 'docs/javascripts/version-selector.js')
| -rw-r--r-- | docs/javascripts/version-selector.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/docs/javascripts/version-selector.js b/docs/javascripts/version-selector.js deleted file mode 100644 index fb0a187..0000000 --- a/docs/javascripts/version-selector.js +++ /dev/null @@ -1,39 +0,0 @@ -(function () { - fetch("/versions.json") - .then((r) => r.json()) - .then((data) => { - const currentPath = window.location.pathname; - const pathParts = currentPath.split("/").filter((p) => p); - const currentVersion = pathParts[0] || "latest"; - - const header = document.querySelector(".md-header__inner"); - if (!header) return; - - const select = document.createElement("select"); - select.className = "md-version-select"; - select.style.cssText = - "margin-left: 1rem; padding: 0.25rem 0.5rem; border-radius: 0.25rem; background: var(--md-default-bg-color); border: 1px solid var(--md-default-fg-color--lighter);"; - - data.versions.forEach((v) => { - const option = document.createElement("option"); - option.value = v.version; - option.textContent = v.title; - if (v.version === currentVersion) { - option.selected = true; - } - select.appendChild(option); - }); - - select.addEventListener("change", (e) => { - const newVersion = e.target.value; - const remainingPath = pathParts.slice(1).join("/"); - window.location.href = - "/" + newVersion + (remainingPath ? "/" + remainingPath : "/"); - }); - - header.appendChild(select); - }) - .catch((err) => { - console.error("Failed to load version selector:", err); - }); -})(); |