mirror of
https://github.com/vercel/commerce.git
synced 2025-05-22 01:16:58 +00:00
feat: add a basic product ld schema on product details page
This commit is contained in:
parent
a5e799b16e
commit
b3c80b53b2
@ -58,8 +58,22 @@ export default async function ProductPage({ params }: { params: { handle: string
|
|||||||
|
|
||||||
if (!product) return notFound();
|
if (!product) return notFound();
|
||||||
|
|
||||||
|
const productJsonLd = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'Product',
|
||||||
|
name: product.title,
|
||||||
|
description: product.description,
|
||||||
|
image: product.featuredImage.url
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<script
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: JSON.stringify(productJsonLd)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<div className="lg:grid lg:grid-cols-6">
|
<div className="lg:grid lg:grid-cols-6">
|
||||||
<div className="lg:col-span-4">
|
<div className="lg:col-span-4">
|
||||||
<Gallery
|
<Gallery
|
||||||
|
Loading…
x
Reference in New Issue
Block a user