fix changelog 404 redirect

This commit is contained in:
afc163 2016-05-10 19:08:46 +08:00
parent 52690ea2dd
commit 45c98fdad2

View File

@ -1,4 +1,8 @@
<script>
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
location.href = '/#' + location.pathname.replace(/\/?#/, '?scrollTo=' + prefix);
if (location.pathname === '/changelog') {
location.href = '/#/docs/react/' + location.pathname.replace(/\/?#/, '?scrollTo=' + prefix);
} else {
location.href = '/#' + location.pathname.replace(/\/?#/, '?scrollTo=' + prefix);
}
</script>