import { NextResponse } from "next/server"; import { getAllPosts } from "@/lib/posts"; const SITE_URL = "https://denizbektas.com.tr"; const staticPages = [ { url: "/", priority: "1.0", changefreq: "weekly" }, { url: "/merhaba", priority: "0.8", changefreq: "monthly" }, { url: "/hakkimda", priority: "0.8", changefreq: "monthly" }, { url: "/su-anda", priority: "0.7", changefreq: "weekly" }, { url: "/misyon", priority: "0.6", changefreq: "monthly" }, { url: "/blog", priority: "0.9", changefreq: "weekly" }, { url: "/infosec", priority: "0.9", changefreq: "weekly" }, { url: "/notebook", priority: "0.8", changefreq: "weekly" }, { url: "/seyir-defteri", priority: "0.7", changefreq: "weekly" }, { url: "/faydali-linkler", priority: "0.7", changefreq: "monthly" }, { url: "/roadmap", priority: "0.8", changefreq: "monthly" }, { url: "/takim-cantam", priority: "0.6", changefreq: "monthly" }, { url: "/hobilerim", priority: "0.5", changefreq: "monthly" }, { url: "/fikirlerim", priority: "0.7", changefreq: "monthly" }, { url: "/projeler", priority: "0.8", changefreq: "monthly" }, { url: "/podcast", priority: "0.7", changefreq: "weekly" }, { url: "/iletisim", priority: "0.6", changefreq: "monthly" }, { url: "/ozgecmis", priority: "0.7", changefreq: "monthly" }, { url: "/aktivite", priority: "0.6", changefreq: "daily" }, { url: "/rss-beslemeleri", priority: "0.5", changefreq: "monthly" }, { url: "/statboard", priority: "0.5", changefreq: "monthly" }, { url: "/altyapi", priority: "0.5", changefreq: "monthly" }, { url: "/tesekkurler", priority: "0.4", changefreq: "yearly" }, { url: "/gizlilik", priority: "0.3", changefreq: "yearly" }, { url: "/kullanim-kosullari", priority: "0.3", changefreq: "yearly" }, ]; export async function GET() { const posts = getAllPosts(); const now = new Date().toISOString().split("T")[0]; const staticUrls = staticPages .map( (p) => ` ${SITE_URL}${p.url} ${now} ${p.changefreq} ${p.priority} ` ) .join(""); const postUrls = posts .map( (p) => ` ${SITE_URL}/${p.category}/${p.slug} ${p.date} monthly 0.8 ` ) .join(""); const xml = ` ${staticUrls} ${postUrls} `; return new NextResponse(xml, { headers: { "Content-Type": "application/xml; charset=utf-8", "Cache-Control": "public, max-age=86400" }, }); }