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