next-seo icon indicating copy to clipboard operation
next-seo copied to clipboard

Is it possible to add custom LD objects ?

Open mercteil opened this issue 5 years ago • 8 comments

I see some fields are not supported by the lib.

Is it possible to add custom LD data objects, that will not be validated by the lib?

mercteil avatar Dec 27 '19 08:12 mercteil

I can take a look at this. Could you give me an example to work with?

garmeeh avatar Jan 08 '20 21:01 garmeeh

For instance I want to add a graph with multiple products:

{
  "@context": "http://schema.org",
  "@graph": [
{
  "@type": "Product",
  "name": "tshirt",
  "description": "test copy 1.",
  "image": "image.jpg"
},
{
  "@type": "Product",
  "name": "tshirt 2",
  "description": "test copy 2.",
  "image": "image2.jpg"
}
]
}

Or when I am missing the GTIN or MPN google throws a warning. I could omit the warning by setting identifier_exists: false which seems not to be supported by this lib.

Basically this request is made to be able to tweak LData when this library cannot process it by default.

EDIT: identifier_exists: false seems also not being supported by google as well (although they have it in docs)

mercteil avatar Jan 17 '20 11:01 mercteil

Also I would like to add multiple offers in EUR and in USD for example ...

mercteil avatar Jan 18 '20 16:01 mercteil

I'm trying to add sitelinks search box, see: https://developers.google.com/search/docs/data-types/sitelinks-searchbox#example, up ❤️

inkloop avatar Jul 23 '20 20:07 inkloop

@garmeeh +1 for this feature. Because this library doesn't support every Schema option, and because Schema could also change, it would be nice to have an escape hatch of sorts.

Something like —

<LogoJsonLd
    logo="http://www.your-site.com/images/logo.jpg"
    url="http://www.your-site.com"
    custom={{
        alt: 'Your site logo'
    }}
/>

Assuming alt is a Schema object that isn't currently supported by LogoJsonLd. Everything in custom will be passed on to the JSON+LD object as-is.

paambaati avatar Dec 03 '20 13:12 paambaati

+1 for the feature

thiras avatar Feb 21 '21 20:02 thiras

very good proposition, +1 too

svassaux avatar Apr 17 '21 17:04 svassaux

+1 for this feature. There will always be different versions of schemas, so custom ones should be possible. I.e. WebPageJsonLd could have name & primaryImageOfPage

anttiku avatar Mar 08 '22 14:03 anttiku

strongly requesting this feature. The LD structure is changing time to time but this lib could not catch up

yfhui avatar Jul 26 '23 02:07 yfhui