feat: add a basic product ld schema on product details page

This commit is contained in:
abhu-A-J 2023-05-12 16:08:03 +05:30
parent a5e799b16e
commit b3c80b53b2

View File

@ -58,8 +58,22 @@ export default async function ProductPage({ params }: { params: { handle: string
if (!product) return notFound();
const productJsonLd = {
'@context': 'https://schema.org',
'@type': 'Product',
name: product.title,
description: product.description,
image: product.featuredImage.url
};
return (
<div>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(productJsonLd)
}}
/>
<div className="lg:grid lg:grid-cols-6">
<div className="lg:col-span-4">
<Gallery