diff --git a/docs/404.html b/docs/404.html
index 6fe9c55..eac75ae 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -14,7 +14,7 @@
Loading downloads...
@@ -80,6 +80,33 @@
content.setAttribute("aria-hidden", isOpen ? "false" : "true");
});
}
+
+ // short url for jumping to versions
+ document.addEventListener("DOMContentLoaded", () => {
+ const allowedMajors = ["1", "2", "3"];
+ const hash = window.location.hash.trim();
+ if (!hash.startsWith("#v")) return;
+ const fullMatch = hash.match(/^#v(\d+)-(\d+)-(\d+)$/);
+ const majorMatch = hash.match(/^#v(\d+)$/);
+ let target = null;
+ let major = null;
+ if (fullMatch) {
+ major = fullMatch[1];
+ if (allowedMajors.includes(major)) {
+ target = `/versions/versions_${major}.x/${hash}`;
+ }
+ } else if (majorMatch) {
+ major = majorMatch[1];
+ if (allowedMajors.includes(major)) {
+ target = `/versions/versions_${major}.x/`;
+ }
+ }
+ if (target) {
+ window.location.replace(target);
+ } else {
+ window.location.replace("/404.html");
+ }
+ });