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(v2): Added OG Image Api Support #3027

Closed
wants to merge 10 commits into from

Conversation

FocalChord
Copy link
Contributor

Motivation

This is a draft for how we will be integrating Docusaurus with the backend for OG Image which @Drewbi will be hosting

Addresses issue #2968

Have you read the Contributing Guidelines on pull requests?

Yes

@FocalChord FocalChord changed the title Social card test feat(v2): Added OG Image Api Support Jul 7, 2020
@facebook-github-bot
Copy link
Contributor

Hi @FocalChord!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jul 7, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 5309602

https://deploy-preview-3027--docusaurus-2.netlify.app

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 7, 2020
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@FocalChord
Copy link
Contributor Author

@slorber thoughts on this?

@slorber
Copy link
Collaborator

slorber commented Jul 10, 2020

that seems like a good first draft, but to make this feature configurable, we need the user to be able to provide his custom function for createOGImage, instead of a hardcoded one. If he adds a fn in site config, we can only run this fn in node, not in client-side/layout.

I see 2 possible solutions:

  • createOGImage in config + run it in node + inject the generated image as route props (requires integrating in each plugin)
  • OgImage theme comp, used by Layout, with a default (but configurable with config) impl to generate the og image url. Users could then use swizzle to customize it to their needs

The 1st solution seems more work to me, but could also be more convenient, as it would be a global conf fn, and does not require swizzling

The 2nd solution would make this feature theme-specific, and would be more simple to implement. But maybe people implementing their own themes would like to benefit from this system as well?

Not sure which solution is best one yet.

@slorber
Copy link
Collaborator

slorber commented Aug 11, 2020

Hey everyone. Just wanted to know if everything is fine on your side or if you need some help.

Please keep me posted about your work on this feature :)

@Drewbi
Copy link
Contributor

Drewbi commented Aug 12, 2020

Hey thanks for checking in. I've gotten a basic api setup with only a few css issues but I think the part I have the least idea about is how to run the custom function provided by the user. You said we can run it in node but I'm not quite sure how that interaction would work/where the relevant files we would need to add are.

@Josh-Cena
Copy link
Collaborator

Closing due to inactivity

@Josh-Cena Josh-Cena closed this Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants