You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

9 lines
428 B

<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' + scrollToString;
} else {
location.href = '/#' + location.pathname.replace(/\/$/, '') + scrollToString;
}
</script>