diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index c47be30..7864436 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -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 { 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( + (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, + ]; } diff --git a/src/features/rehber/components/rehber-makale.tsx b/src/features/rehber/components/rehber-makale.tsx index bd7612a..4443ced 100644 --- a/src/features/rehber/components/rehber-makale.tsx +++ b/src/features/rehber/components/rehber-makale.tsx @@ -8,6 +8,7 @@ import { breadcrumbJsonLd, sayfaMetadata, } from "@/lib/seo"; +import { trTarih } from "@/lib/tarih"; import { CtaSiraForm } from "@/features/sihirbaz/components/cta-sira-form"; import { ElCizimiSema } from "./el-cizimi-sema"; import { RehberKapak } from "./rehber-kapak"; @@ -29,7 +30,11 @@ export function rehberYaziMetadata(slug: string): Metadata { title: yazi.baslik, description: yazi.aciklama, path: `/rehber/${slug}`, - openGraph: { type: "article", publishedTime: yazi.tarih }, + openGraph: { + type: "article", + publishedTime: yazi.tarih, + modifiedTime: yazi.guncelleme ?? yazi.tarih, + }, }); } @@ -49,6 +54,7 @@ export function RehberMakale({ slug }: { slug: string }) { description: yazi.aciklama, path: `/rehber/${slug}`, datePublished: yazi.tarih, + dateModified: yazi.guncelleme, })} /> {yazi.aciklama}

+

+ Yayın: + {yazi.guncelleme ? ( + <> + {" · "}Güncelleme:{" "} + + + ) : null} +