From a2758da094b7fc75358df242ccc2ca7185c8de29 Mon Sep 17 00:00:00 2001 From: Tiago Braga Date: Thu, 8 Feb 2024 14:57:53 -0300 Subject: [PATCH 1/2] fix properties BreadCrumbJsonLdProps --- cypress/e2e/profilePage.spec.js | 12 ++++-------- package.json | 2 +- src/utils/schema/setItemListElements.ts | 6 ++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/profilePage.spec.js b/cypress/e2e/profilePage.spec.js index 339ff675..1c43b05d 100644 --- a/cypress/e2e/profilePage.spec.js +++ b/cypress/e2e/profilePage.spec.js @@ -24,18 +24,14 @@ describe('ProfilePage JSON-LD', () => { { '@type': 'ListItem', position: 1, - item: { - '@id': 'https://example.com/books', - name: 'Books', - }, + '@id': 'https://example.com/books', + name: 'Books', }, { '@type': 'ListItem', position: 2, - item: { - '@id': 'https://example.com/books/authors', - name: 'Authors', - }, + '@id': 'https://example.com/books/authors', + name: 'Authors', }, ], }, diff --git a/package.json b/package.json index 346fa502..73eccdc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-seo", - "version": "6.4.0", + "version": "6.4.1", "description": "SEO plugin for Next.js projects", "source": "src/index.tsx", "main": "lib/next-seo.js", diff --git a/src/utils/schema/setItemListElements.ts b/src/utils/schema/setItemListElements.ts index 5f34204c..ba3c2248 100644 --- a/src/utils/schema/setItemListElements.ts +++ b/src/utils/schema/setItemListElements.ts @@ -5,10 +5,8 @@ export function setItemListElements(items: ItemListElements[]) { return items.map(item => ({ '@type': 'ListItem', position: item.position, - item: { - '@id': item.item, - name: item.name, - }, + '@id': item.item, + name: item.name, })); } From c9c5898f57a5153788ca6ee8c74b959d4fe64e66 Mon Sep 17 00:00:00 2001 From: Tiago Braga Date: Thu, 8 Feb 2024 16:03:50 -0300 Subject: [PATCH 2/2] --amend --- cypress/e2e/breadcrumb.spec.js | 25 ++++++++----------------- cypress/e2e/profilePage.spec.js | 4 ++-- src/utils/schema/setItemListElements.ts | 2 +- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/breadcrumb.spec.js b/cypress/e2e/breadcrumb.spec.js index 020f84d8..0a7ad692 100644 --- a/cypress/e2e/breadcrumb.spec.js +++ b/cypress/e2e/breadcrumb.spec.js @@ -21,35 +21,26 @@ describe('Breadcrumb JSON-LD', () => { { '@type': 'ListItem', position: 1, - item: { - '@id': 'https://example.com/books', - name: 'Books', - }, + item: 'https://example.com/books', + name: 'Books', }, { '@type': 'ListItem', position: 2, - item: { - '@id': 'https://example.com/books/authors', - name: 'Authors', - }, + item: 'https://example.com/books/authors', + name: 'Authors', }, { '@type': 'ListItem', position: 3, - item: { - '@id': 'https://example.com/books/authors/annleckie', - name: 'Ann Leckie', - }, + item: 'https://example.com/books/authors/annleckie', + name: 'Ann Leckie', }, { '@type': 'ListItem', position: 4, - item: { - '@id': - 'https://example.com/books/authors/annleckie/ancillaryjustice', - name: 'Ancillary Justice', - }, + item: 'https://example.com/books/authors/annleckie/ancillaryjustice', + name: 'Ancillary Justice', }, ], }); diff --git a/cypress/e2e/profilePage.spec.js b/cypress/e2e/profilePage.spec.js index 1c43b05d..ae6a70d2 100644 --- a/cypress/e2e/profilePage.spec.js +++ b/cypress/e2e/profilePage.spec.js @@ -24,13 +24,13 @@ describe('ProfilePage JSON-LD', () => { { '@type': 'ListItem', position: 1, - '@id': 'https://example.com/books', + item: 'https://example.com/books', name: 'Books', }, { '@type': 'ListItem', position: 2, - '@id': 'https://example.com/books/authors', + item: 'https://example.com/books/authors', name: 'Authors', }, ], diff --git a/src/utils/schema/setItemListElements.ts b/src/utils/schema/setItemListElements.ts index ba3c2248..e1db00c1 100644 --- a/src/utils/schema/setItemListElements.ts +++ b/src/utils/schema/setItemListElements.ts @@ -5,7 +5,7 @@ export function setItemListElements(items: ItemListElements[]) { return items.map(item => ({ '@type': 'ListItem', position: item.position, - '@id': item.item, + item: item.item, name: item.name, })); }