Enhance university-related components by adding logo support and improving search functionality. Introduced a new "logolar" script in package.json, updated KatalogArama to include rehber results, and integrated UniLogo component across various pages for better visual representation. Refactored UniversiteIcerik and TercihHaritasi to display logos conditionally, enhancing user experience. Additionally, made adjustments to styles and layout for improved responsiveness and clarity.
All checks were successful
Deploy / deploy (push) Successful in 16m24s

This commit is contained in:
bilalgursen
2026-08-01 20:17:48 +03:00
parent ff66480227
commit f27f3ffaac
254 changed files with 1035 additions and 154 deletions

View File

@@ -1,33 +1,10 @@
import { NextResponse, type NextRequest } from "next/server";
import { aramaNormalize as normalize, eslesmePuani } from "@/lib/arama";
import { getAllBolumler, getAllUniversiteler } from "@/lib/katalog";
import { trBaslikDuzeni } from "@/lib/slug";
const SONUC_SINIRI = 6;
function normalize(metin: string): string {
return metin
.toLocaleLowerCase("tr-TR")
.replace(/ı/g, "i")
.replace(/ş/g, "s")
.replace(/ğ/g, "g")
.replace(/ü/g, "u")
.replace(/ö/g, "o")
.replace(/ç/g, "c")
.replace(/â/g, "a")
.replace(/î/g, "i")
.replace(/û/g, "u")
.normalize("NFKD")
.replace(/[̀-ͯ]/g, "");
}
function eslesmePuani(ad: string, sorgu: string): number {
const normalAd = normalize(ad);
if (normalAd === sorgu) return 0;
if (normalAd.startsWith(sorgu)) return 1;
if (normalAd.split(/\s+/).some((kelime) => kelime.startsWith(sorgu))) return 2;
return 3;
}
export function GET(request: NextRequest) {
const hamSorgu = request.nextUrl.searchParams.get("q")?.trim() ?? "";
const sorgu = normalize(hamSorgu).slice(0, 80);