Skip to content

Commit

Permalink
Add redirection for wiki links.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed Nov 13, 2023
1 parent 0f17e4b commit b7102d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const bugSimplifiedRegex = /^\/bug\/(.*)/;
const bugPath = "/bugs/show_bug.cgi"
const bugSearchRegex = /^\?id=(.*)/;
const wikiRegex = /^\/cocorico\/(.*)/;
if (stdlibRegex.test(path)) {
window.location = path.replace(stdlibRegex, "/doc/<#CURRENTVERSIONTAG>/stdlib/");
} else if (refmanRegex.test(path)) {
Expand Down Expand Up @@ -35,6 +36,9 @@
} else if (bugPath == path && bugSearchRegex.test(window.location.search)) {
const bugId = window.location.search.match(bugSearchRegex)[1];
window.location = "https://github.com/coq/coq/issues?q=is%3Aissue%20%22Original%20bug%20ID%3A%20BZ%23" + bugId + "%22"
} else if (wikiRegex.test(path)) {
const wikiLocation = path.match(wikiRegex)[1];
window.location = "https://github.com/coq/coq/wiki/" + wikiLocation
} else {
document.write("<h1>Not found</h1>");
}
Expand Down

0 comments on commit b7102d0

Please sign in to comment.