feat: implement advanced Service, CreativeWork and Breadcrumb schema markup
This commit is contained in:
@@ -49,10 +49,69 @@ export default async function ServiceLocationPage({ params }: Props) {
|
||||
|
||||
const projects = await getProjectsByService(service.title);
|
||||
|
||||
const breadcrumbLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 1,
|
||||
"name": "Ana Sayfa",
|
||||
"item": "https://mugladijitalmedya.com"
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 2,
|
||||
"name": "Hizmetlerimiz",
|
||||
"item": "https://mugladijitalmedya.com/services"
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 3,
|
||||
"name": service.title,
|
||||
"item": `https://mugladijitalmedya.com/services/${service.slug}`
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 4,
|
||||
"name": location.name,
|
||||
"item": `https://mugladijitalmedya.com/services/${service.slug}/${location.slug}`
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const serviceLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Service",
|
||||
"serviceType": service.title,
|
||||
"provider": {
|
||||
"@type": "Organization",
|
||||
"name": "Muğla Dijital",
|
||||
"url": "https://mugladijitalmedya.com"
|
||||
},
|
||||
"areaServed": {
|
||||
"@type": "City",
|
||||
"name": location.name
|
||||
},
|
||||
"description": `${location.name} bölgesinde profesyonel ${service.title.toLowerCase()} çözümleri.`,
|
||||
"offers": {
|
||||
"@type": "Offer",
|
||||
"availability": "https://schema.org/InStock",
|
||||
"areaServed": location.name
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="min-h-screen bg-[#f5f5f0] text-black pt-24">
|
||||
<Navbar />
|
||||
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbLd) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(serviceLd) }}
|
||||
/>
|
||||
{/* Hero Section */}
|
||||
<section className="pt-24 pb-16 px-6 md:px-12 border-b border-black/10">
|
||||
<div className="max-w-7xl mx-auto">
|
||||
|
||||
@@ -25,5 +25,58 @@ export default async function ProjectDetailPage({ params }: { params: Promise<{
|
||||
const data = await getProjectBySlug(slug);
|
||||
if (!data) notFound();
|
||||
|
||||
return <WorkDetailClient project={data.project} nextProject={data.nextProject} />;
|
||||
const breadcrumbLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 1,
|
||||
"name": "Ana Sayfa",
|
||||
"item": "https://mugladijitalmedya.com"
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 2,
|
||||
"name": "Çalışmalarımız",
|
||||
"item": "https://mugladijitalmedya.com/works"
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 3,
|
||||
"name": data.project.title,
|
||||
"item": `https://mugladijitalmedya.com/works/${data.project.slug}`
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const creativeWorkLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "CreativeWork",
|
||||
"name": data.project.title,
|
||||
"description": data.project.subtitle,
|
||||
"image": data.project.hero_image,
|
||||
"author": {
|
||||
"@type": "Organization",
|
||||
"name": "Muğla Dijital"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "Muğla Dijital"
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbLd) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(creativeWorkLd) }}
|
||||
/>
|
||||
<WorkDetailClient project={data.project} nextProject={data.nextProject} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user