mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-26 12:10:06 +08:00
fix 404 redirect
This commit is contained in:
parent
ffcd2624d7
commit
4e72f85788
5
404.html
5
404.html
@ -1,8 +1,9 @@
|
||||
<script>
|
||||
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
|
||||
var scrollToString = location.hash ? '?scrollTo=' + prefix + location.hash : '';
|
||||
if (location.pathname === '/changelog') {
|
||||
location.href = '/#/docs/react/changelog?scrollTo=' + location.hash;
|
||||
location.href = '/#/docs/react/changelog' + scrollToString;
|
||||
} else {
|
||||
location.href = '/#' + location.pathname + '?scrollTo=' + prefix + location.hash;
|
||||
location.href = '/#' + location.pathname + scrollToString;
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user