-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
[Blog] OpenGraph description tag stumbles with img tags #403
Comments
Hm I don't see anything in #407 that might address this. The issue shows up when Facebook's OpenGraph scraper runs through a blog post. The scraper does not use the blog feed AFAIK, it uses the og meta tags in the head section for the blog post. |
Gotcha - ok. This is a quasi-bug, I think vs. a feature request. We can treat it as such. |
Running into same issues, we are seeing raw markdown in the og:description instead of the rendered html |
@mattkanwisher Hi! What version of Docusaurus are you using? See https://docusaurus.io/docs/en/installation.html to find out how to check. We thought we may have fixed this in 1.0.6 - https://github.com/facebook/Docusaurus/blob/master/CHANGELOG.md%23106---2018-02-12 and just forgot to close this issue. |
From our package.lock here You can see if you curl https://loomx.io/developers/docs/en/phaser-sdk-demo.html | grep og:description
|
Interesting... In other Docusaurus sites, that bug is gone:
or
The only thing I see different in yours, assuming you are indeed running Docusaurus 1.06 or greater, is that your og:description is an image. Maybe that could be the bug. |
Docusaurus will automatically generate OpenGraph metatags based on a blog post's content. One of the tags, 'description', is generated by grabbing the markdown content up to the first line break. If the blog post has a reference in markdown to an image at the top, it will avoid using the image as the description:
The issue arises when instead of a 'raw image render string', the markdown content uses a plain
<img>
tag. In that case, the img html tag will be used as the description, which is not ideal.Example
Raw post:
Result:
http://opengraphcheck.com/result.php?url=https%3A%2F%2Ffacebook.github.io%2Freact-native%2Fblog%2F2018%2F01%2F18%2Fimplementing-twitters-app-loading-animation-in-react-native.html
Proposed Fix
We'd need to update our logic to account for raw HTML as well. Essentially, we want the first bit of plain text in the blog post, with no other HTML elements.
The text was updated successfully, but these errors were encountered: