import { site } from "@/lib/site";

export function locationTitle(location:string){
  return `Panti Asuhan di ${location} | Al Jannah Semarang`;
}

export function locationDescription(location:string){
  return `Informasi panti asuhan di ${location}, Jawa Tengah, panduan donasi anak yatim, program sosial, dan rujukan Panti Asuhan Al Jannah Semarang.`;
}

export function absolute(path:string){
  return `${site.url}${path.startsWith('/') ? path : `/${path}`}`;
}

export function breadcrumbJson(items:{name:string;url:string}[]){
  return {
    "@context":"https://schema.org",
    "@type":"BreadcrumbList",
    itemListElement: items.map((item,i)=>({"@type":"ListItem",position:i+1,name:item.name,item:absolute(item.url)}))
  };
}
