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

Open Graph tags missing required property of og:type #5373

Closed
5 tasks done
johnnyreilly opened this issue Aug 18, 2021 · 12 comments
Closed
5 tasks done

Open Graph tags missing required property of og:type #5373

johnnyreilly opened this issue Aug 18, 2021 · 12 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@johnnyreilly
Copy link
Contributor

🐛 Bug Report

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io
  • I have read the console error message carefully (if applicable)

Description

Open Graph tags are amazing and I've been reading up on them. There's four that are required:

og:title - The title of your object as it should appear within the graph, e.g., "The Rock".
og:type - The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required.
og:image - An image URL which should represent your object within the graph.
og:url - The canonical URL of your object that will be used as its permanent ID in the graph, e.g., "https://www.imdb.com/title/tt0117500/".

Docusaurus does not provide og:type at present. It would be good if it did; perhaps with a value of website or article. eg:

<meta property="og:type" content="article" />

Have you read the Contributing Guidelines on issues?

Yes

Steps to reproduce

Look at the og tags on the docusaurus website: https://docusaurus.io/blog

Expected behavior

To have an og:type tag

Actual behavior

Does not have og:type tag

Your environment

All environments

Reproducible demo

Look at the og tags on the docusaurus website: https://docusaurus.io/blog

Given the work in #5355 @lex111 - I wondered if you might have thoughts on this too.

@johnnyreilly johnnyreilly added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 18, 2021
@lex111
Copy link
Contributor

lex111 commented Aug 18, 2021

According to this page, og:type is additional type and provides default value (website) if it is not specified. We can probably use og:type article on blog pages, but is it really necessary?

@johnnyreilly
Copy link
Contributor Author

The page linked to is how Facebook use the Open Graph tags; so whilst the lack of og:type shouldn't be an issue with Facebook, Open Graph metadata is consumed by many other platforms; Twitter, Google etc who may make different choices.

Even if we just supply the default value of:

<meta property="og:type" content="website" />

it will then be explicitly specified and also opens the possibility for more customisation further down the line.

I've been slightly going down the rabbit hole of reading about all this stuff, I'd quite like the ability for us to do more in this space in future perhaps. Not quite sure what that would look like, feels like a combination of docusarus.config.js and Frontmatter could be combined to provide even more amazing metadata!

@lex111
Copy link
Contributor

lex111 commented Aug 18, 2021

This is a quote from OG protocol, so if og:type is not specified, website should be used as default value. Therefore for Google and others platforms, missing og:type should not be problem.

Any non-marked up webpage should be treated as og:type website.

@johnnyreilly
Copy link
Contributor Author

johnnyreilly commented Aug 18, 2021

Good find - maybe it's not really a specific issue generally.

We can probably use og:type article on blog pages

Agree this could be a good idea.

@slorber
Copy link
Collaborator

slorber commented Aug 18, 2021

PRs welcome to add that type

Was wondering what type is a doc page and shouldn't we add relevant structured data on docs too?

@johnnyreilly
Copy link
Contributor Author

I've got something locally that's pretty generic - I'll put it up for comments. Should serve a number of purposes I think

@johnnyreilly
Copy link
Contributor Author

See related PR: #5375

slorber added a commit that referenced this issue Aug 20, 2021
* feat: add metatags support for seo / blogposts

* feat: different implementation

* feat: use isBlogPostPage

* feat: implement in BlogPostPage-remove Seo changes

* Revert "feat: implement in BlogPostPage-remove Seo changes"

This reverts commit 1cba459

* Move Seo to BlogPostPage + some fixes

* fix social preview asset

* Fix blog social image + improve a bit Seo setup

* fix bootstrap theme

Co-authored-by: John <john.reilly@investec.co.uk>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
@Josh-Cena
Copy link
Collaborator

@johnnyreilly May I know what the state of this issue is? Is og:type actually necessary, or is adding the other meta tags sufficient?

@johnnyreilly
Copy link
Contributor Author

I've actually forgotten where this ended up. I don't think any changes have been made - I haven't checked recently and I'm away from a machine right now

@sh0umik
Copy link

sh0umik commented Mar 20, 2022

will it ever get fixed or merged ?

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Mar 20, 2022

Based on the discussion above, we are still unsure whether it's required or even needed. If you want to send a PR to add it, I'm okay to merge it, but this is not prioritized. I haven't even triaged this issue for that purpose.

@johnnyreilly Any thoughts?

@johnnyreilly
Copy link
Contributor Author

Sorry I think this was resolved with my PR - will close

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

5 participants