Skip to content

Commit 0dae7af

Browse files
committed
Skip i18n middleware for /templates path
1 parent f0f1c51 commit 0dae7af

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

apps/web/src/middleware.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import { locales } from "@workspace/i18n/config";
66
const handleI18nRouting = createMiddleware(routing);
77

88
export default async function middleware(req: NextRequest) {
9-
// Skip i18n for /breakpoint/* paths
10-
if (req.nextUrl.pathname.startsWith("/breakpoint")) {
9+
// Skip i18n for /breakpoint/* and /templates/* paths
10+
if (
11+
req.nextUrl.pathname.startsWith("/breakpoint") ||
12+
req.nextUrl.pathname.startsWith("/templates")
13+
) {
1114
return NextResponse.next();
1215
}
1316

@@ -52,6 +55,8 @@ export default async function middleware(req: NextRequest) {
5255
}
5356

5457
export const config = {
55-
matcher: ["/((?!api|opengraph|_next|_vercel|breakpoint|.*\\..*).*)"],
58+
matcher: [
59+
"/((?!api|opengraph|_next|_vercel|breakpoint|templates|.*\\..*).*)",
60+
],
5661
runtime: "nodejs",
5762
};

0 commit comments

Comments
 (0)