-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor: add blog microdata in markup instead of use JSON-LD #5355
Conversation
✔️ [V2] 🔨 Explore the source changes: 347f6fe 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/611672775b8a730007ea692f 😎 Browse the preview: https://deploy-preview-5355--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5355--docusaurus-2.netlify.app/ |
Size Change: +1.17 kB (0%) Total Size: 795 kB
ℹ️ View Unchanged
|
✔️ [V2] 🔨 Explore the source changes: a6a9d53 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6116732589dbd4000732a021 😎 Browse the preview: https://deploy-preview-5355--docusaurus-2.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks nice!
Before merging, any thought @johnnyreilly ?
Note one diff is not the blog index has 3 article items. I don't feel like it should be a problem (and may be a good thing?) but it's worth double-checking how to handle a blog post paginated list?
As I understand correctly, it's no big deal (try to check list page out in the checker). For example, Firebase blog in list of posts uses the same microdata as detail blog post. |
Interesting! I didn't realise this was an option. I'll admit that I have an instinctive preference for JSON-LD as it's more obvious in terms of understanding what the data is. That said, this approach seems to work, as the screenshots attest. I'm curious if there's any advantages to using microdata instead of JSON-LD? Or are they effectively interchangeable? |
Well, I can not guarantee it, but according to the checker, final result on SEO should not change negatively. |
👍 |
IMHO both have their pros and cons but I tend to prefer co-locating things, it improves composability and make sure all pages using a cmp with structured data will be well-understood by crawlers without additional work |
I was just reading around on structured data and found this post which (amongst other things) talks about microdata vs json-ld: https://yoast.com/structured-data-schema-ultimate-guide/#son
It comes down pretty much in favour of JSON-LD instead of microdata. I'm not too sure if it's significant - but I thought I'd mention it as at least interesting. |
Thanks for pointing this out, but just because JSON-LD is the preferred method, that doesn't make microdata less efficient, right? So let's leave the option with using microdata until we see confirmation that this format is worse. |
I wouldn't claim expertise in this area. But they do come down firmly in favour of JSON-LD and against microdata:
Happy to leave as is for now. But we should probably keep this under review if the industry is moving in the direction of JSON-LD |
I'd rather keep microdata for now, as I find it more convenient for composition. We'll see if any limit is encountered and eventually migrate to json-ld |
Cool - I found this article from 2019: https://www.searchenginejournal.com/google-structured-data-preference/297479/
Assuming what it says still stands, JSON-LD is preferred by Google, but not required which is good. And their tools seem to confirm that. |
Motivation
Instead of using JSON-LD, we can annotate current markup to support the BlogPosting schema.
Refs
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Try to test markup blog page on https://search.google.com/test/rich-results
The results below are relevant to first post on
blog/2021/05/12/announcing-docusaurus-two-beta