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
All checks were successful
Deploy / deploy (push) Successful in 16m24s
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { getAllUniversiteler } from "@/lib/katalog";
|
||||
import { trBaslikDuzeni } from "@/lib/slug";
|
||||
import { uniLogoYolu } from "@/lib/uni-logolar";
|
||||
import {
|
||||
createOgSayfaImage,
|
||||
OG_CONTENT_TYPE,
|
||||
@@ -25,9 +28,24 @@ export default async function Image({
|
||||
}
|
||||
parcalar.push("2025 yerleştirme verileri");
|
||||
|
||||
// Logo dosyası varsa OG kartına data URI olarak gömülür; okuma hatası
|
||||
// kartı düşürmesin diye sessizce logosuz karta düşülür.
|
||||
let logo: string | undefined;
|
||||
if (uniLogoYolu(slug)) {
|
||||
try {
|
||||
const buf = await readFile(
|
||||
path.join(process.cwd(), "public", "uni-logo", `${slug}.png`),
|
||||
);
|
||||
logo = `data:image/png;base64,${buf.toString("base64")}`;
|
||||
} catch {
|
||||
logo = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return createOgSayfaImage({
|
||||
eyebrow: "Üniversite",
|
||||
title: `${ad} taban puanları`,
|
||||
description: parcalar.join(" · "),
|
||||
logo,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import { Sayfalama, SAYFA_BOYU } from "@/components/sayfalama";
|
||||
import { PagePixelDivider } from "@/components/pixel-decor";
|
||||
import { UniversiteKonumHaritasi } from "@/components/universite-konum-haritasi";
|
||||
import { UniversiteProgramTablosu } from "@/components/universite-program-tablosu";
|
||||
import { UniLogo } from "@/components/uni-logo";
|
||||
import { uniLogoYolu } from "@/lib/uni-logolar";
|
||||
import type { Program } from "@/lib/db";
|
||||
|
||||
const sayi = (n: number) => n.toLocaleString("tr-TR");
|
||||
@@ -89,6 +91,9 @@ export function UniversiteIcerik({
|
||||
"@type": "CollegeOrUniversity",
|
||||
name: uni.ad,
|
||||
url: `${SITE_URL}/universite/${slug}`,
|
||||
...(uniLogoYolu(slug)
|
||||
? { logo: `${SITE_URL}${uniLogoYolu(slug)}` }
|
||||
: {}),
|
||||
...(uni.il
|
||||
? {
|
||||
address: {
|
||||
@@ -133,10 +138,13 @@ export function UniversiteIcerik({
|
||||
)}
|
||||
</nav>
|
||||
|
||||
<h1 className="mt-3 font-heading text-3xl font-bold text-slate-900 sm:text-4xl">
|
||||
{uni.ad} Taban Puanları 2026
|
||||
{ilkSayfa ? "" : ` — Sayfa ${sayfa}`}
|
||||
</h1>
|
||||
<div className="mt-4 flex items-center gap-4">
|
||||
<UniLogo slug={slug} ad={uni.ad} boy="lg" />
|
||||
<h1 className="font-heading text-3xl font-bold text-slate-900 sm:text-4xl">
|
||||
{uni.ad} Taban Puanları 2026
|
||||
{ilkSayfa ? "" : ` — Sayfa ${sayfa}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
{ilkSayfa ? (
|
||||
<>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { JsonLd, breadcrumbJsonLd } from "@/lib/seo";
|
||||
import { CtaSiraForm } from "@/components/cta-sira-form";
|
||||
import { SiteFooter } from "@/components/site-footer";
|
||||
import { PagePixelDivider } from "@/components/pixel-decor";
|
||||
import { UniLogo } from "@/components/uni-logo";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Üniversitelerin Taban Puanları ve Sıralamaları 2026",
|
||||
@@ -18,17 +19,22 @@ const sayi = (n: number) => n.toLocaleString("tr-TR");
|
||||
|
||||
function UniLinkleri({ uniler }: { uniler: UniOzet[] }) {
|
||||
return (
|
||||
<ul className="mt-3 grid gap-x-6 gap-y-1.5 sm:grid-cols-2">
|
||||
<ul className="mt-4 grid gap-x-6 gap-y-2 sm:grid-cols-2">
|
||||
{uniler.map((u) => (
|
||||
<li key={u.slug}>
|
||||
<Link
|
||||
href={`/universite/${u.slug}`}
|
||||
className="group inline-flex items-baseline gap-2 text-sm text-slate-700 hover:text-primary"
|
||||
className="group flex items-center gap-3 text-sm text-slate-700 hover:text-primary"
|
||||
>
|
||||
<span className="group-hover:underline">{u.ad}</span>
|
||||
<span className="text-xs text-slate-400">
|
||||
{u.il ? `${trBaslikDuzeni(u.il)} · ` : ""}
|
||||
{sayi(u.programSayisi)} program
|
||||
<UniLogo slug={u.slug} ad={u.ad} boy="sm" />
|
||||
<span className="min-w-0">
|
||||
<span className="block truncate group-hover:underline">
|
||||
{u.ad}
|
||||
</span>
|
||||
<span className="block text-xs text-slate-400">
|
||||
{u.il ? `${trBaslikDuzeni(u.il)} · ` : ""}
|
||||
{sayi(u.programSayisi)} program
|
||||
</span>
|
||||
</span>
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user