Skip to content

Commit adbaad4

Browse files
committed
[site] Allow URLs of the form scenedetect.com/issue/200
1 parent ad9d35d commit adbaad4

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

website/mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ markdown_extensions: [fenced_code]
3939

4040
extra_css:
4141
- style.css
42+
43+
extra_javascript:
44+
- redirect.js

website/pages/issue.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# Going to Github Issues...
3+
4+
Redirecting to Github Issues.

website/pages/issues.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# Going to Github Issues...
3+
4+
Redirecting to Github Issues.

website/pages/redirect.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
(function() {
3+
var path = window.location.pathname;
4+
5+
const TARGETS = [ 'issue', 'issues' ]
6+
for (const target of TARGETS) {
7+
if (path == target) {
8+
window.location.href = 'https://github.com/Breakthrough/PySceneDetect/issues/';
9+
}
10+
}
11+
12+
const PREFIXES = ['/issue/', '/issues/']
13+
for (const prefix of PREFIXES) {
14+
if (path.startsWith(prefix)) {
15+
var issueNumber = path.substring(prefix.length);
16+
if (issueNumber) {
17+
var newUrl = 'https://github.com/Breakthrough/PySceneDetect/issues/' + issueNumber;
18+
window.location.href = newUrl;
19+
}
20+
}
21+
}
22+
})();

0 commit comments

Comments
 (0)