diff --git a/prerender/seo/product.cjs b/prerender/seo/product.cjs
index dc2e71e..0ef59f5 100644
--- a/prerender/seo/product.cjs
+++ b/prerender/seo/product.cjs
@@ -86,7 +86,7 @@ const generateProductJsonLd = (product, baseUrl, config, categoryInfo = null) =>
const priceValidDate = new Date();
priceValidDate.setMonth(priceValidDate.getMonth() + 3);
- const jsonLd = {
+ const productJsonLd = {
"@context": "https://schema.org/",
"@type": "Product",
name: product.name,
@@ -150,9 +150,14 @@ const generateProductJsonLd = (product, baseUrl, config, categoryInfo = null) =>
},
};
- // Add breadcrumb if category information is available
+ const productScript = ``;
+
+ // BreadcrumbList is not a valid property on Product; emit as its own JSON-LD block (WebPage path context).
if (categoryInfo && categoryInfo.name && categoryInfo.seoName) {
- jsonLd.breadcrumb = {
+ const breadcrumbJsonLd = {
+ "@context": "https://schema.org/",
"@type": "BreadcrumbList",
itemListElement: [
{
@@ -175,11 +180,13 @@ const generateProductJsonLd = (product, baseUrl, config, categoryInfo = null) =>
},
],
};
+ const breadcrumbScript = ``;
+ return `${productScript}\n${breadcrumbScript}`;
}
- return ``;
+ return productScript;
};
module.exports = {