refactor: Update JSON-LD itemListElement structure in category SEO to include URL field for better clarity and compliance with SEO standards

This commit is contained in:
sebseb7
2026-03-28 17:37:38 +01:00
parent 5e5a733d36
commit ab55761411

View File

@@ -121,11 +121,15 @@ const generateCategoryJsonLd = (category, products = [], baseUrl, config) => {
"@id": id.itemList, "@id": id.itemList,
"@type": "ItemList", "@type": "ItemList",
numberOfItems: withUrls.length, numberOfItems: withUrls.length,
itemListElement: withUrls.map((product, index) => ({ itemListElement: withUrls.map((product, index) => {
const productPageUrl = `${root}/Artikel/${product.seoName}`;
return {
"@type": "ListItem", "@type": "ListItem",
position: index + 1, position: index + 1,
item: `${root}/Artikel/${product.seoName}`, url: productPageUrl,
})), item: productPageUrl,
};
}),
}); });
} }