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

Look in entire document for Schema.org metadata not just head #1664

Merged
merged 1 commit into from Nov 28, 2018

Conversation

Projects
None yet
2 participants
@westonruter
Copy link
Member

westonruter commented Nov 27, 2018

The JSON-LD script elements can appear anywhere in a document, not just the head. This fixes the detection to account for that so that when another plugin outputs Schema.org metadata, the AMP plugin won't output a duplicate.

Fixes #1659

@westonruter westonruter added this to the v1.0 milestone Nov 27, 2018

@westonruter westonruter requested a review from kienstra Nov 27, 2018

@kienstra

This comment has been minimized.

Copy link
Collaborator

kienstra commented Nov 28, 2018

Approved

Hi @westonruter,
This looks good. I also saw that the plugin doesn't output Schema.org metadata if it's already in the document, like in the footer:

schema-appears-footer

And if the metadata isn't already present, the plugin still outputs it like before.

@westonruter westonruter merged commit 19a043a into 1.0 Nov 28, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.