directory.ts 608 B

123456789101112131415
  1. export default defineNuxtRouteMiddleware(( to, from ) => {
  2. let redirectPath = to.path.endsWith('/') ? to.path.slice(0, -1) : to.path;
  3. switch( redirectPath ){
  4. case '/docs/getting-started':
  5. return navigateTo( redirectPath+'/these-images-vs-others', { replace: true } );
  6. break;
  7. case '/docs/guide':
  8. return navigateTo( redirectPath+'/choosing-the-right-image', { replace: true } );
  9. break;
  10. case '/docs/reference':
  11. return navigateTo( redirectPath+'/environment-variable-specification', { replace: true } );
  12. break;
  13. }
  14. })