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:
@@ -121,11 +121,15 @@ const generateCategoryJsonLd = (category, products = [], baseUrl, config) => {
|
||||
"@id": id.itemList,
|
||||
"@type": "ItemList",
|
||||
numberOfItems: withUrls.length,
|
||||
itemListElement: withUrls.map((product, index) => ({
|
||||
"@type": "ListItem",
|
||||
position: index + 1,
|
||||
item: `${root}/Artikel/${product.seoName}`,
|
||||
})),
|
||||
itemListElement: withUrls.map((product, index) => {
|
||||
const productPageUrl = `${root}/Artikel/${product.seoName}`;
|
||||
return {
|
||||
"@type": "ListItem",
|
||||
position: index + 1,
|
||||
url: productPageUrl,
|
||||
item: productPageUrl,
|
||||
};
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user