Skip to content

Commit

Permalink
Add handling for the /distrib/current/ sub-paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed Oct 12, 2023
1 parent 5038407 commit 9ec0e10
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@
window.location = path.replace(stdlibRegex, "/doc/<#CURRENTVERSIONTAG>/stdlib/");
} else if (refmanRegex.test(path)) {
const version = path.match(refmanRegex)[1];
window.location = path.replace(refmanRegex, "/doc/" + version + "/refman/");
if (version == "current") {
window.location = path.replace(refmanRegex, "/doc/<#CURRENTVERSIONTAG>/refman/");
}
else {
window.location = path.replace(refmanRegex, "/doc/" + version + "/refman/");
}
} else if (stdlibDistribRegex.test(path)) {
const version = path.match(stdlibDistribRegex)[1];
window.location = path.replace(stdlibDistribRegex, "/doc/" + version + "/stdlib/");
if (version == "current") {
window.location = path.replace(stdlibDistribRegex, "/doc/<#CURRENTVERSIONTAG>/stdlib/");
}
else {
window.location = path.replace(stdlibDistribRegex, "/doc/" + version + "/stdlib/");
}
} else {
document.write("<h1>Not found</h1>");
}
Expand Down

0 comments on commit 9ec0e10

Please sign in to comment.