From bdc450bd3d4789109bfdc4e4ded14b07d45a66ae Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 9 Oct 2024 15:04:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fix=20collection=20includesO?= =?UTF-8?q?bject=20json-ld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nft/collection/_collectionId/index.vue | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/pages/nft/collection/_collectionId/index.vue b/src/pages/nft/collection/_collectionId/index.vue index 12930a0c6b..12ee784d66 100644 --- a/src/pages/nft/collection/_collectionId/index.vue +++ b/src/pages/nft/collection/_collectionId/index.vue @@ -163,7 +163,7 @@ export default { if (this.collectionPrice) { schemas.push({ '@context': 'http://schema.org', - '@type': 'ProductCollection', + '@type': ['Product', 'ProductCollection'], name: this.collectionName, description: this.collectionDescription, image: ogImage, @@ -175,30 +175,35 @@ export default { iscn_owner: iscnOwner, } = this.getNFTClassMetadataById(id); return { - '@type': this.collectionIsBook ? 'Book' : 'CreativeWork', - name: className, - description: classDescription, - image: classImage, - url: `${EXTERNAL_HOST}/nft/class/${id}`, - author: iscnOwner - ? { - '@context': 'http://www.schema.org', - '@type': 'Person', - url: `${EXTERNAL_HOST}/${iscnOwner}`, - identifier: iscnOwner, - } - : undefined, - brand: this.collectionIsBook - ? { - '@type': 'Brand', - url: `${EXTERNAL_HOST}/about/nft-book`, - name: 'NFT Book', - } - : { - '@type': 'Brand', - url: `${EXTERNAL_HOST}/about/writing-nft`, - name: 'Writing NFT', - }, + '@type': 'TypeAndQuantityNode', + typeOfGood: { + '@type': this.collectionIsBook ? 'Book' : 'CreativeWork', + name: className, + description: classDescription, + image: classImage, + url: `${EXTERNAL_HOST}/nft/class/${id}`, + author: iscnOwner + ? { + '@context': 'http://www.schema.org', + '@type': 'Person', + url: `${EXTERNAL_HOST}/${iscnOwner}`, + identifier: iscnOwner, + } + : undefined, + brand: this.collectionIsBook + ? { + '@type': 'Brand', + url: `${EXTERNAL_HOST}/about/nft-book`, + name: 'NFT Book', + } + : { + '@type': 'Brand', + url: `${EXTERNAL_HOST}/about/writing-nft`, + name: 'Writing NFT', + }, + }, + amountOfThisGood: '1', + unitCode: 'C62', }; }), offers: { From b71544ec2ae13d4a43f61044e312b81222ccb060 Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 9 Oct 2024 18:15:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Fix=20missing=20context=20in?= =?UTF-8?q?=20json-ld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nuxt.config.js | 40 ++----------------- src/pages/about/writing-nft.vue | 3 ++ src/pages/civic/index.vue | 2 + src/pages/index.vue | 2 + src/pages/nft/class/_classId/_nftId.vue | 3 ++ src/pages/nft/class/_classId/index.vue | 7 ++++ .../nft/collection/_collectionId/index.vue | 5 +++ 7 files changed, 26 insertions(+), 36 deletions(-) diff --git a/src/nuxt.config.js b/src/nuxt.config.js index 4720f49fa1..6dc7527023 100644 --- a/src/nuxt.config.js +++ b/src/nuxt.config.js @@ -164,16 +164,19 @@ const nuxtConfig = { ], brand: [ { + '@context': 'http://www.schema.org', '@type': 'Brand', url: 'https://liker.land/about/writing-nft', name: 'Writing NFT', }, { + '@context': 'http://www.schema.org', '@type': 'Brand', url: 'https://liker.land/about/nft-book', name: 'NFT Book', }, { + '@context': 'http://www.schema.org', '@type': 'Brand', url: 'https://liker.land/civic', name: 'Civic Liker', @@ -188,42 +191,7 @@ const nuxtConfig = { operatingSystem: 'All', url: 'https://liker.land', offers: { - '@type': 'Offer', - price: '0', - priceCurrency: 'USD', - }, - }, - { - '@context': 'http://www.schema.org', - '@type': 'MobileApplication', - name: 'Liker Land', - applicationCategory: 'LifestyleApplication', - operatingSystem: 'IOS', - url: 'https://apps.apple.com/app/liker-land/id1248232355', - aggregateRating: { - '@type': 'AggregateRating', - ratingValue: '4.3', - ratingCount: '16', - }, - offers: { - '@type': 'Offer', - price: '0', - priceCurrency: 'USD', - }, - }, - { - '@context': 'http://www.schema.org', - '@type': 'MobileApplication', - name: 'Liker Land', - applicationCategory: 'LifestyleApplication', - operatingSystem: 'ANDROID', - url: 'https://play.google.com/store/apps/details?id=com.oice', - aggregateRating: { - '@type': 'AggregateRating', - ratingValue: '3.8', - ratingCount: '1699', - }, - offers: { + '@context': 'http://www.schema.org', '@type': 'Offer', price: '0', priceCurrency: 'USD', diff --git a/src/pages/about/writing-nft.vue b/src/pages/about/writing-nft.vue index 8906145dcd..d60e7082a8 100644 --- a/src/pages/about/writing-nft.vue +++ b/src/pages/about/writing-nft.vue @@ -50,15 +50,18 @@ export default { '@context': 'http://www.schema.org', '@type': 'FAQPage', about: { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/writing-nft`, name: 'Writing NFT', }, mainEntity: this.$t('faq_list').map( ({ q: question, a: answer }) => ({ + '@context': 'http://www.schema.org', '@type': 'Question', name: question, acceptedAnswer: { + '@context': 'http://www.schema.org', '@type': 'Answer', text: answer, }, diff --git a/src/pages/civic/index.vue b/src/pages/civic/index.vue index 6d27f47f09..f8d245ebb7 100644 --- a/src/pages/civic/index.vue +++ b/src/pages/civic/index.vue @@ -71,12 +71,14 @@ export default { image: [ogImage], description, brand: { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/civic`, name: 'Civic Liker', }, url: `${EXTERNAL_HOST}${this.$route.path}`, offers: { + '@context': 'http://www.schema.org', '@type': 'Offer', price: '0', priceCurrency: 'USD', diff --git a/src/pages/index.vue b/src/pages/index.vue index ae69138a1c..5e27c93fd4 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -847,9 +847,11 @@ export default { '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: this.faqs.map(({ question, answer }) => ({ + '@context': 'http://www.schema.org', '@type': 'Question', name: question, acceptedAnswer: { + '@context': 'http://www.schema.org', '@type': 'Answer', text: answer, }, diff --git a/src/pages/nft/class/_classId/_nftId.vue b/src/pages/nft/class/_classId/_nftId.vue index 502e018c61..1354401b34 100644 --- a/src/pages/nft/class/_classId/_nftId.vue +++ b/src/pages/nft/class/_classId/_nftId.vue @@ -463,6 +463,7 @@ export default { name: title, encoding: [ { + '@context': 'http://www.schema.org', '@type': 'MediaObject', contentUrl: this.nftModelURL, encodingFormat: 'model/gltf-json', @@ -473,12 +474,14 @@ export default { let brand; if (this.isWritingNft) { brand = { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/writing-nft`, name: 'Writing NFT', }; } else if (this.nftIsNFTBook) { brand = { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/nft-book`, name: 'NFT Book', diff --git a/src/pages/nft/class/_classId/index.vue b/src/pages/nft/class/_classId/index.vue index 6b58e43691..6212de1ac6 100644 --- a/src/pages/nft/class/_classId/index.vue +++ b/src/pages/nft/class/_classId/index.vue @@ -548,6 +548,7 @@ export default { name: title, encoding: [ { + '@context': 'http://www.schema.org', '@type': 'MediaObject', contentUrl: this.nftModelURL, encodingFormat: 'model/gltf-json', @@ -566,6 +567,7 @@ export default { image: [ogImage], description, brand: { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/writing-nft`, name: 'Writing NFT', @@ -576,6 +578,7 @@ export default { datePublished: this.iscnData?.recordTimestamp, url: `${EXTERNAL_HOST}${this.$route.path}`, offers: { + '@context': 'http://www.schema.org', '@type': 'Offer', seller: iscnOwnerPerson, price: NFTPriceUSD, @@ -598,6 +601,7 @@ export default { image: [ogImage], description, brand: { + '@context': 'http://www.schema.org', '@type': 'Brand', url: 'https://liker.land/about/nft-book', name: 'NFT Book', @@ -615,6 +619,7 @@ export default { }; this.nftEditions.forEach(e => { schemas.push({ + '@context': 'http://www.schema.org', '@type': ['Book', 'Product'], '@id': `@${this.classId}-${e.index}`, name: `${title} - ${e.name}`, @@ -627,11 +632,13 @@ export default { bookEdition: e.name, description: e.description, brand: { + '@context': 'http://www.schema.org', '@type': 'Brand', url: 'https://liker.land/about/nft-book', name: 'NFT Book', }, offers: { + '@context': 'http://www.schema.org', '@type': 'Offer', seller: iscnOwnerPerson, price: e.price, diff --git a/src/pages/nft/collection/_collectionId/index.vue b/src/pages/nft/collection/_collectionId/index.vue index 12ee784d66..16032ba161 100644 --- a/src/pages/nft/collection/_collectionId/index.vue +++ b/src/pages/nft/collection/_collectionId/index.vue @@ -175,8 +175,10 @@ export default { iscn_owner: iscnOwner, } = this.getNFTClassMetadataById(id); return { + '@context': 'http://www.schema.org', '@type': 'TypeAndQuantityNode', typeOfGood: { + '@context': 'http://www.schema.org', '@type': this.collectionIsBook ? 'Book' : 'CreativeWork', name: className, description: classDescription, @@ -192,11 +194,13 @@ export default { : undefined, brand: this.collectionIsBook ? { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/nft-book`, name: 'NFT Book', } : { + '@context': 'http://www.schema.org', '@type': 'Brand', url: `${EXTERNAL_HOST}/about/writing-nft`, name: 'Writing NFT', @@ -207,6 +211,7 @@ export default { }; }), offers: { + '@context': 'http://www.schema.org', '@type': 'Offer', price: this.collectionPrice, priceCurrency: 'USD',