feat: add dynamic site settings, hero media, admin panels, and database integration

This commit is contained in:
mstfyldz
2026-06-05 16:59:05 +03:00
parent 121e127f6b
commit 94182b6bc5
27 changed files with 1894 additions and 52 deletions
+31
View File
@@ -0,0 +1,31 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
const locales = ["tr", "en"];
const defaultLocale = "tr";
export function proxy(request: NextRequest) {
// Check if there is any supported locale in the pathname
const { pathname } = request.nextUrl;
if (pathname.startsWith('/admin')) {
return;
}
const pathnameHasLocale = locales.some(
(locale) => pathname.startsWith(`/${locale}/`) || pathname === `/${locale}`
);
if (pathnameHasLocale) return;
// If no locale found, redirect to default locale
request.nextUrl.pathname = `/${defaultLocale}${pathname}`;
return NextResponse.redirect(request.nextUrl);
}
export const config = {
matcher: [
// Skip all internal paths (_next) and static files
'/((?!api|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
],
};