Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed JSON-LD syntax and description tag #7

Merged
merged 1 commit into from
Nov 1, 2020

Conversation

wbrowar
Copy link
Contributor

@wbrowar wbrowar commented Jul 1, 2020

Hey Ben, I didn't use this plugin since I'm loading my somatic stuff differently, but I grabbed everything from line 70 down and added it to a custom script which seems to work as intended.

After running my Nuxt site through Google’s URL inspector it caught a syntax error with the JSON-LD script tags. I think what's getting stringified was an array instead of just the value of the object, (I was seeing ["breadcrumbList","{BREADCRUMB_VALUES}"] instead of just "{BREADCRUMB_VALUES}". Line 120 should fix that, but maybe a sanity check might be good there, too.

Regarding the "description" meta tag, I noticed it wasn’t overriding the default one picked up in my HTML template, so adding a hid set to "description" should do the trick there.

Hey Ben, I didn't use this plugin since I'm loading my somatic stuff differently, but I grabbed everything from line 70 down and added it to a custom script which seems to work as intended.

After running my Nuxt site through Google’s URL inspector it caught a syntax error with the JSON-LD script tags. I think what's getting stringified was an array instead of just the value of the object, (I was seeing `["breadcrumbList","{BREADCRUMB_VALUES}"]` instead of just `"{BREADCRUMB_VALUES}"`. Line 120 should fix that, but maybe a sanity check might be good there, too.

Regarding the "description" meta tag, I noticed it wasn’t overriding the default one picked up in my HTML template, so adding a `hid` set to "description" should do the trick there.
@ben-rogerson
Copy link
Owner

hey will thanks for for the PR on this. All looks good at first glance and I'll have a proper review shortly. Cheers!

@ben-rogerson ben-rogerson merged commit e4f683a into ben-rogerson:master Nov 1, 2020
@ben-rogerson
Copy link
Owner

4 months later... damn I'm shocking. Well, at least it's going in!

@Toni-hr98
Copy link

The error i get when updating to v0.2.1:

Schermafbeelding 2020-11-20 om 10 15 28

@Toni-hr98
Copy link

Uploading Schermafbeelding 2020-11-20 om 10.20.49.png…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants