Skip to content

Commit

Permalink
Fix redirect path
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jan 25, 2024
1 parent e7bfd46 commit a715af8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/routes/router.$version.docs.$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const loader = async (context: LoaderFunctionArgs) => {
branch: getBranch(version),
docPath: `docs/${docsPath}`,
currentPath: url,
redirectPath: url.replace(/\/docs.*/, '/docs/react/overview'),
redirectPath: url.replace(/\/docs.*/, '/docs/framework/react/overview'),
})
}

Expand Down
2 changes: 1 addition & 1 deletion app/routes/router.$version.docs._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { redirect } from '@remix-run/node'

export const loader: LoaderFunction = (context) => {
throw redirect(
context.request.url.replace(/\/docs.*/, '/docs/react/overview')
context.request.url.replace(/\/docs.*/, '/docs/framework/react/overview')
)
}
2 changes: 1 addition & 1 deletion app/routes/router.$version.docs.framework.$framework.$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const loader = async (context: LoaderFunctionArgs) => {
branch: getBranch(version),
docPath: `docs/framework/${framework}/${docsPath}`,
currentPath: url,
redirectPath: url.replace(/\/docs.*/, '/docs/react/overview'),
redirectPath: url.replace(/\/docs.*/, '/docs/framework/react/overview'),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import type { LoaderFunctionArgs } from '@remix-run/node'

export const loader = async (context: LoaderFunctionArgs) => {
throw redirect(
context.request.url.replace(/\/docs.*/, '/docs/react/overview')
context.request.url.replace(/\/docs.*/, '/docs/framework/react/overview')
)
}

0 comments on commit a715af8

Please sign in to comment.