import type {MetadataRoute} from "next";
import {site} from "@/lib/site";
import {jatengRegions,semarangDistricts,slugify} from "@/lib/regions";
import {seoArticles} from "@/lib/articles";
export default function sitemap():MetadataRoute.Sitemap{const now=new Date();const fixed=["","/profil","/program","/kegiatan","/donasi","/kontak","/artikel","/panti-asuhan-semarang","/panti-asuhan-jawa-tengah"].map(path=>({url:`${site.url}${path}`,lastModified:now,changeFrequency:"weekly" as const,priority:path===""?1:path==="/panti-asuhan-semarang"?.95:.8}));const articles=seoArticles.map(a=>({url:`${site.url}/artikel/${a.slug}`,lastModified:now,changeFrequency:"monthly" as const,priority:.72}));const jateng=jatengRegions.filter(r=>r.slug!=="kota-semarang").map(r=>({url:`${site.url}/panti-asuhan-jawa-tengah/${r.slug}`,lastModified:now,changeFrequency:"monthly" as const,priority:.66}));const districts=semarangDistricts.map(d=>({url:`${site.url}/panti-asuhan-semarang/${d.slug}`,lastModified:now,changeFrequency:"monthly" as const,priority:.78}));const villages=semarangDistricts.flatMap(d=>d.villages.map(v=>({url:`${site.url}/panti-asuhan-semarang/${d.slug}/${slugify(v)}`,lastModified:now,changeFrequency:"monthly" as const,priority:.62})));return [...fixed,...articles,...jateng,...districts,...villages]}
