-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e31652
commit 473afe1
Showing
3 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ site.lang | default: " en-US" }}"> | ||
|
||
<head> | ||
<meta charset='utf-8'> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}"> | ||
<script> | ||
const paths = window.location.href.split('/'); | ||
const pattern = /^(zh-CN|zh-TW|en-US|fr-FR)$/; | ||
let lang_index = -1; | ||
for (let i = 0; i < paths.length; ++i) { | ||
if (pattern.test(paths[i])) { | ||
lang_index = i; | ||
break; | ||
} | ||
} | ||
|
||
if (lang_index !== -1) { | ||
const lang = paths[lang_index]; | ||
if (lang === 'zh-CN') { | ||
window.location.href = paths.slice(0, 4).join('/') + '/unavailable'; | ||
} else if (lang === 'en-US' || lang === 'zh-TW') { | ||
const new_paths = paths.slice(0, lang_index).concat('zh-CN').concat(paths.slice(lang_index + 1)); | ||
window.location.href = new_paths.join('/'); | ||
} else { | ||
const new_paths = paths.slice(0, lang_index).concat('en-US').concat(paths.slice(lang_index + 1)); | ||
window.location.href = new_paths.join('/'); | ||
} | ||
} else { | ||
window.location.href = paths.slice(0, 4).join('/') + '/unavailable'; | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<h2>404</h2> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Unavailable | ||
|
||
This resource is unavailable. | ||
|
||
## [Back to Home](./) |