forem / forem

For empowering community 🌱
https://forem.com
GNU Affero General Public License v3.0
21.93k stars 4.03k forks source link

Embed format: GitHub Projects #17688

Open amywtlin opened 2 years ago

amywtlin commented 2 years ago

Background

This is discussed in https://github.com/forem/forem/discussions/17289 and I am creating an issue to open this up for community contributions.

@jeremyf mentioned that as the links to GitHub Projects do not come with meta data we could leverage right away, this would require some work for the backend.

Definition of done (expected behavior)

When embedding a public GitHub project link in the editor (such as this one), we should render an embed, with specified data shown and in the generic format.

github-actions[bot] commented 2 years ago

Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you.

Feature requests that require more discussion may be closed. Read more about our feature request process on forem.dev.

To our amazing contributors: issues labeled bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.

To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem-team. The OSS Community Manager or the engineers on OSS rotation will follow up.

For full info on how to contribute, please check out our contributors guide.

amywtlin commented 2 years ago

@ludwiczakpawel I was looking for the finalized embed design spec and I think this is the one. Can you confirm? If it is the correct one, I'll need you to make the spec available here in the issue (I think we don't intend to share figma files publicly, right?), so contributors could also work on this issue.

Also - assigning this issue to you for now, and feel free to assign back to me when we have design spec here (feel free to edit my issue).

amywtlin commented 2 years ago

@jeremyf You mentioned in the discussion #17289 this will be customized and we need to decide what to show. Can you point me to a list of available data so I can evaluate what we should show?

Also assigning this issue to you for this information - feel free to unassign yourself when we have the requested information.

ludwiczakpawel commented 2 years ago

Couple thoughts to make sure we're on the same page...

@jeremyf also question (out of curiosity): if we can't access anything useful through meta tags, then how do we do that? Through github's API or something?

jeremyf commented 2 years ago

@ludwiczakpawel

also question (out of curiosity): if we can't access anything useful through meta tags, then how do we do that? Through github's API or something?

We render a simple URL, assuming all the fallback conditions work correctly.

jeremyf commented 2 years ago

@ludwiczakpawel

GitHub Projects do have opengraph/twitter meta data in the markup. But it's too generic, correct?

It depends on what product wants to display; it might be adequate. The easiest thing to do would be to "wire in the project URL and see what happens" and from that take the next step of "do we design something specific or not"

amywtlin commented 2 years ago

I looked around how our existing GitHub embeds look like and I actually think it wasn't about creating a special format for the Projects. I agree with Pawel that most of the content we might want to show in an embed would be dynamic, which will not be suitable as we don't regenerate embeds.

It however doesn't create a generic embed with a public project link. @jeremyf Is that correct to assume we should at least be able to get a fallback embed with a public GitHub project link?

I tested with this link on Canary1 and it's throwing me this error:

Screen Shot 2022-06-06 at 2 18 48 PM

I think if we are supposed to be able to show a generic embed, fixing this issue should be good enough, instead of creating a special embed.