Skip to content

Commit a52fee4

Browse files
authored
Fix #98: Redirect to main branch when only lang slug is present (#167)
* Add docs/$lang.ts file for redirection
1 parent f54dbcd commit a52fee4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/routes/docs.$lang.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { redirect, type LoaderFunctionArgs } from "@remix-run/node";
2+
export async function loader({ params }: LoaderFunctionArgs) {
3+
const { lang, ref } = params;
4+
return !ref ? redirect(`/docs/${lang}/main`) : null;
5+
}

0 commit comments

Comments
 (0)