Files
kolaytercih/src/app/sitemap.ts
bilalgursen a43c045828
All checks were successful
Deploy / deploy (push) Successful in 5m1s
feat(katalog+tasarim): devlet/vakıf tür sayfaları, tür çipleri link; kayıtlı-sıra satırı şişko ve sade
- /universiteler/devlet ve /universiteler/vakif: şehir sayfası iskeleti,
  haritada bu türden üniversitesi olan her il turuncu (yakınlaşma yok), üç
  özet kartı, şehir çipleri (sayfa içi çapa), şehir şehir §4.15 satırları,
  öteki türe geçiş hapı; metadata + sitemap.
- TurCipi tek kaynak: devlet/vakıf çipi tür sayfasına link (sonuç, listem,
  tadımlık, bölüm, şehir/tür satırları); üniversite sayfası tür hapı ve
  /universiteler başlıkları da link. UniSatirlari ortak dosyada: ad, tür ve
  il ayrı linkler.
- Kompakt profilli satır (DESIGN.md §10.9): iri kupa kutusu + text-3xl/4xl
  sıra, text-xl/2xl başlık, 48 px buton; telefonda alt alta, lg'de tek satır.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 15:53:54 +03:00

101 lines
3.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { MetadataRoute } from "next";
import { KATALOG_VERI_TARIHI, SITE_URL } from "@/lib/seo";
import {
getAllBolumSlugs,
getAllIlSlugs,
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}/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}/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 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,
];
}