-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (32 loc) · 1.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<title>Redirection page for se-passau.github.io</title>
</head>
<body>
<!-- textual representaion -->
<div id="redirection">
Trying to redirect to <a href="https://se-sic.github.io/${repoName}">https://se-sic.github.io/${repoName}</a> in a second...
</div>
<div id="noscript">
<noscript>Automatic redirect does not work due to disabled JavaScript. Enable JavaScript or perform the redirection by yourself.</noscript>
</div>
<script>
// get accessed URL
const sRelativeURL = window.location.pathname;
const sRepoName = sRelativeURL.substring(1, sRelativeURL.indexOf("/", 1) + 1);
// construct redirection URL
const sRedirectionBase = "https://se-sic.github.io/";
const sRedirectionURL = sRedirectionBase + sRepoName;
// add URL to predefined HTML link
const oDOMNodeLink = document.querySelector("#redirection a");
oDOMNodeLink.innerHTML = sRedirectionURL;
oDOMNodeLink.href = sRedirectionURL;
// actually redirect with timeout
const iRedirectionTimeout = 1; // in seconds
setTimeout(function() {
window.location.href = sRedirectionURL;
}, iRedirectionTimeout * 1000);
</script>
</body>
</html>