Üniversite sayfasında bir programa tıklayınca /universite/<üni>/<ad>-<kod> adresinde programın sayfası açılır: yıllara göre taban, kontenjan türleri, son yerleşenin netleri, yerleşme koşulları, mezun istihdamı, üniversite ve tabanı en yakın diğer üniversiteler; masaüstünde içindekiler, telefonda okuma cetveli. Dört listedeki "i" çekmecesi ve /api/program-ayrinti kalktı; satır adları ve özet kartları sayfaya gider. 21.493 sayfa ilk ziyarette üretilir ve bellekte tutulur (isrFlushToDisk: false), site haritasına girdi. Spec S-015, DESIGN §4.47. Bu commit bağlı olduğu, henüz commit'lenmemiş 2.6.x işini de taşır: - 2.6.0 rehber: içindekiler ve okuma cetveli (bileşen ortak yere, src/components/icindekiler.tsx'e taşındı) - 2.6.1 404 ekranı ortada - 2.6.2 arama penceresi sadeleşti - 2.6.3 üst çubuk logosu eski boyutunda Paralel parallax/yumuşak kaydırma işi (lenis dahil) bu commit'te yok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
128 lines
4.1 KiB
TypeScript
128 lines
4.1 KiB
TypeScript
import type { MetadataRoute } from "next";
|
||
import { KATALOG_VERI_TARIHI, SITE_URL } from "@/lib/seo";
|
||
import {
|
||
getAllBolumSlugs,
|
||
getAllIlSlugs,
|
||
getAllProgramSayfaYollari,
|
||
getAllUniversiteSlugs,
|
||
} from "@/lib/katalog";
|
||
import { getAllRehberler } from "@/lib/rehber";
|
||
import { BOLUM_SINIFLARI, bolumSinifiHref } from "@/lib/bolum-sinifi";
|
||
|
||
// Bilinçli olarak sitemap DIŞI: /sonuc (noindex), /giris, /listem,
|
||
// /odeme/sonuc, /rapor/yazdir (auth/utility sayfaları).
|
||
const staticEntries: MetadataRoute.Sitemap = [
|
||
{ url: `${SITE_URL}/`, priority: 1, changeFrequency: "weekly" },
|
||
{
|
||
url: `${SITE_URL}/bolumler`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.8,
|
||
changeFrequency: "weekly",
|
||
},
|
||
// Bölüm sınıfları: /bolumler/sayisal … /bolumler/kiz-ogrenci
|
||
...BOLUM_SINIFLARI.map((s) => ({
|
||
url: `${SITE_URL}${bolumSinifiHref(s)}`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.7,
|
||
changeFrequency: "monthly" as const,
|
||
})),
|
||
{
|
||
url: `${SITE_URL}/universiteler`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.8,
|
||
changeFrequency: "weekly",
|
||
},
|
||
{
|
||
url: `${SITE_URL}/universiteler/devlet`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.7,
|
||
changeFrequency: "monthly",
|
||
},
|
||
{
|
||
url: `${SITE_URL}/universiteler/vakif`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.7,
|
||
changeFrequency: "monthly",
|
||
},
|
||
{
|
||
url: `${SITE_URL}/universite-siralamasi`,
|
||
priority: 0.7,
|
||
changeFrequency: "yearly",
|
||
},
|
||
{ url: `${SITE_URL}/paket`, priority: 0.7, changeFrequency: "monthly" },
|
||
{ url: `${SITE_URL}/meraklisina`, priority: 0.6, changeFrequency: "monthly" },
|
||
{ url: `${SITE_URL}/iletisim`, priority: 0.3, changeFrequency: "yearly" },
|
||
{ url: `${SITE_URL}/surum-notlari`, priority: 0.3, changeFrequency: "monthly" },
|
||
{ url: `${SITE_URL}/gizlilik`, priority: 0.2, changeFrequency: "yearly" },
|
||
{
|
||
url: `${SITE_URL}/cerez-politikasi`,
|
||
priority: 0.2,
|
||
changeFrequency: "yearly",
|
||
},
|
||
{ url: `${SITE_URL}/kosullar`, priority: 0.2, changeFrequency: "yearly" },
|
||
];
|
||
|
||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||
const bolumler: MetadataRoute.Sitemap = getAllBolumSlugs().map((slug) => ({
|
||
url: `${SITE_URL}/bolum/${slug}`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.7,
|
||
changeFrequency: "monthly",
|
||
}));
|
||
const universiteler: MetadataRoute.Sitemap = getAllUniversiteSlugs().map(
|
||
(slug) => ({
|
||
url: `${SITE_URL}/universite/${slug}`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.6,
|
||
changeFrequency: "monthly",
|
||
}),
|
||
);
|
||
// Program sayfaları (S-015): her üniversitedeki her program, ~21.500 adres.
|
||
// Tek dosyada kalır (Google sınırı 50.000 adres): rehber yayın kontrolü
|
||
// (AGENTS.md) sitemap.xml'i tek dosya olarak sayıyor.
|
||
const programlar: MetadataRoute.Sitemap = getAllProgramSayfaYollari().map(
|
||
(yol) => ({
|
||
url: `${SITE_URL}${yol}`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.5,
|
||
changeFrequency: "monthly",
|
||
}),
|
||
);
|
||
const iller: MetadataRoute.Sitemap = getAllIlSlugs().map((slug) => ({
|
||
url: `${SITE_URL}/universiteler/${slug}`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.6,
|
||
changeFrequency: "monthly",
|
||
}));
|
||
const yazilar = getAllRehberler();
|
||
const rehberler: MetadataRoute.Sitemap = yazilar.map((y) => ({
|
||
url: `${SITE_URL}/rehber/${y.slug}`,
|
||
lastModified: y.guncelleme ?? y.tarih,
|
||
priority: 0.7,
|
||
changeFrequency: "monthly",
|
||
}));
|
||
// /rehber dizini en son dokunulan yazı kadar tazedir (ISO tarihler metin
|
||
// olarak karşılaştırılabilir). Hiç yazı yoksa lastmod hiç yazılmaz.
|
||
const rehberSonDegisiklik = yazilar
|
||
.map((y) => y.guncelleme ?? y.tarih)
|
||
.reduce<string | undefined>(
|
||
(enBuyuk, t) => (enBuyuk === undefined || t > enBuyuk ? t : enBuyuk),
|
||
undefined,
|
||
);
|
||
const rehberDizini: MetadataRoute.Sitemap[number] = {
|
||
url: `${SITE_URL}/rehber`,
|
||
lastModified: rehberSonDegisiklik,
|
||
priority: 0.8,
|
||
changeFrequency: "weekly",
|
||
};
|
||
return [
|
||
...staticEntries,
|
||
rehberDizini,
|
||
...bolumler,
|
||
...universiteler,
|
||
...iller,
|
||
...rehberler,
|
||
...programlar,
|
||
];
|
||
}
|