- src/lib/yok-istatistik.ts (scripts/yok-istatistik-uret.py ile üretilir): üniversite başına örgün öğrenci ve öğretim üyesi, öğrenci/üye oranı ve Türkiye medyanı; katalog detayına `istatistik` alanı - /universite-siralamasi: URAP Türkiye sıralaması sayfası (URAP logosu ve zorunlu urapcenter.org atfıyla), sitemap'e eklendi
78 lines
2.6 KiB
TypeScript
78 lines
2.6 KiB
TypeScript
import type { MetadataRoute } from "next";
|
||
import { KATALOG_VERI_TARIHI, SITE_URL } from "@/lib/seo";
|
||
import { getAllBolumSlugs, getAllUniversiteSlugs } from "@/lib/katalog";
|
||
import { getAllRehberler } from "@/lib/rehber";
|
||
|
||
// 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",
|
||
},
|
||
{
|
||
url: `${SITE_URL}/universiteler`,
|
||
lastModified: KATALOG_VERI_TARIHI,
|
||
priority: 0.8,
|
||
changeFrequency: "weekly",
|
||
},
|
||
{
|
||
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}/gizlilik`, 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",
|
||
}),
|
||
);
|
||
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,
|
||
...rehberler,
|
||
];
|
||
}
|