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,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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user