-
Notifications
You must be signed in to change notification settings - Fork 11
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
birchkwok
committed
Sep 16, 2024
1 parent
2fe51a4
commit 7df9a10
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Redirecting...</title> | ||
<script type="text/javascript"> | ||
fetch('/versions.json') | ||
.then(response => response.json()) | ||
.then(versions => { | ||
// 获取最新版本 | ||
const latestVersion = versions[versions.length - 1].version; | ||
// 重定向到最新版本 | ||
window.location.href = `/${latestVersion}/`; | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching versions:', error); | ||
// 如果获取版本失败,可以设置默认重定向 | ||
window.location.href = '/v1.0/'; | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
Redirecting to the latest version of the documentation... | ||
</body> | ||
</html> |