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

feat: LiveBlogPosting #1471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

francoismassart
Copy link

Description of Change(s):

This MR fixes the issue #1468

Documentation

As LiveBlogPosting is just a subtype of Article, I did not update the documentation.

E2E Tests

Cypress tests were added which demonstrate some uses of the live coverage.

Additional information

https://schema.org/LiveBlogPosting

At the moment, the Google Validator does not handle the LiveBlogPosting type while using it in the search results.

The Schema.org validator can handle LiveBlogPosting type but I cannot find which of its fields are required or optional...

Thank you for considering this MR.

const blogVersions = versionSchemas(blog100);
export default blogVersions;
export { blogVersions as default, blog100 };
Copy link
Author

Choose a reason for hiding this comment

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

Needed to reuse the schema inside the liveblog-schema.js

},
coverageStartTime: '2023-11-03T11:00:00+02:00',
coverageEndTime: '2023-11-03T19:00:00+02:00',
liveBlogUpdate: [
Copy link
Author

Choose a reason for hiding this comment

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

The liveBlogUpdate items could contain plenty of additional props because they are instances of BlogPosting but I decided to keep it short.

type: 'array',
items: {
...blog100.schema,
required: ['@type'],
Copy link
Author

Choose a reason for hiding this comment

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

Not all the properties of BlogPosting are required, where could I find out which props are really required in this context ?

Comment on lines +65 to +69
['author', 'mainEntityOfPage'].forEach(key => {
liveblog100.schema.properties.liveBlogUpdate.items.properties[
key
].required = false;
});
Copy link
Author

Choose a reason for hiding this comment

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

Even with required: ['@type'],, the properties:

  • author
  • mainEntityOfPage

are still reported as missing in the E2E tests. As we are using instances BlogPosting as children of liveBlogUpdate these should be optional.

Comment on lines +23 to +43
liveBlogUpdate={[
// From newer to older updates of type BlogPosting
{
'@type': 'BlogPosting',
headline: 'Next.js 14: No New APIs',
articleBody: 'Lorem ipsum dolor sit amet …',
datePublished: '2023-11-03T18:15:00+02:00',
},
{
'@type': 'BlogPosting',
headline: 'A faster, more personalized web.',
articleBody: 'Lorem ipsum dolor sit amet …',
datePublished: '2023-11-03T11:30:00+02:00',
},
{
'@type': 'BlogPosting',
headline: 'Conference will start soon',
articleBody: 'In a few hours …',
datePublished: '2023-11-03T11:00:00+02:00',
},
]}
Copy link
Author

Choose a reason for hiding this comment

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

Is this the correct way to declare the BlogPosting updates ? Feedbacks are welcome 👍

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.

1 participant