feat(rehber): guncelleme alanı → sitemap/JSON-LD/OG/görünür tarih
Frontmatter'a isteğe bağlı `guncelleme` alanı geldi ve uçtan uca akıyor: sitemap lastmod (yazı + /rehber dizini), Article JSON-LD dateModified, og:article modified_time ve makale başlığının altındaki görünür tarih satırı. `tarih`/`guncelleme` YYYY-AA-GG değilse ya da güncelleme yayından önceyse build kırılır. Tarih metni saat diliminden bağımsız `trTarih` ile üretilir. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,6 @@ const staticEntries: MetadataRoute.Sitemap = [
|
||||
priority: 0.8,
|
||||
changeFrequency: "weekly",
|
||||
},
|
||||
{ url: `${SITE_URL}/rehber`, priority: 0.8, changeFrequency: "weekly" },
|
||||
{ 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" },
|
||||
@@ -42,11 +41,32 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
changeFrequency: "monthly",
|
||||
}),
|
||||
);
|
||||
const rehberler: MetadataRoute.Sitemap = getAllRehberler().map((y) => ({
|
||||
const yazilar = getAllRehberler();
|
||||
const rehberler: MetadataRoute.Sitemap = yazilar.map((y) => ({
|
||||
url: `${SITE_URL}/rehber/${y.slug}`,
|
||||
lastModified: y.tarih,
|
||||
lastModified: y.guncelleme ?? y.tarih,
|
||||
priority: 0.7,
|
||||
changeFrequency: "monthly",
|
||||
}));
|
||||
return [...staticEntries, ...bolumler, ...universiteler, ...rehberler];
|
||||
// /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,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user