Skip to content

auto schema generation #2853

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

Merged
merged 3 commits into from
Oct 11, 2021
Merged

auto schema generation #2853

merged 3 commits into from
Oct 11, 2021

Conversation

elalish
Copy link
Contributor

@elalish elalish commented Oct 8, 2021

This adds the generate-schema attribute which automatically generates the 3DModel schema and attaches it to the page's header.

@elalish elalish self-assigned this Oct 8, 2021
@@ -244,11 +244,13 @@ <h2>Setting up <code>&lt;model-viewer&gt;</code> for good Lighthouse scores</h2>
<model-viewer
id="first"
src="../assets/ShopifyModels/Chair.glb"
poster="../assets/ShopifyModels/ChairPoster.png"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had omitted the poster since we're using a custom slotted poster for extreme lazy loading, but we need to specify it here too because that's where the scheme gets the thumbnail info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll test this once it's merged and deployed by checking this example here: https://search.google.com/test/rich-results

@@ -114,7 +116,7 @@ export class ModelScene extends Scene {

this.name = 'ModelScene';

this.element = element;
this.element = element as ModelViewerElement;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably should have done this ages ago; I bet there a bunch of casts (especially in tests) that probably aren't necessary anymore.

@elalish elalish requested review from a user, samaneh-kazemi and tpsiaki October 8, 2021 22:45
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.

2 participants