#256 Issue with organization + repo opengraph meta

Open
opened 2 weeks ago by circlebuilder · 9 comments

I noticed that for one of my repositories (this one) I did not get a onebox URL preview in Discourse.

At first it did not have its own avatar image set, so I think it should then default to the avatar of its organization, am I right? I looked in the html source and it had:

<meta property="og:image" content="https://codeberg.org/user/avatar/innercircles/-1" />

The other OpenGraph meta looked good.

So I uploaded an avatar image, saved and looked at the html again. There was no change. So then I set an avatar from a different project, saved again, and this time the OpenGraph image was set correctly.

Thinking there might be something wrong with the first PNG image, I set that again as the avatar.. but this just worked. There was nothing wrong with the image. Right now I can’t reproduce getting the -1 in the URL anymore, but looks like there may be a bug somewhere at play.

I noticed that for one of my repositories ([this one](https://codeberg.org/innercircles/seedvault)) I did not get a onebox URL preview in Discourse. At first it did not have its own avatar image set, so I think it should then default to the avatar of its organization, am I right? I looked in the html source and it had: ```html <meta property="og:image" content="https://codeberg.org/user/avatar/innercircles/-1" /> ``` The other OpenGraph meta looked good. So I uploaded an avatar image, saved and looked at the html again. There was no change. So then I set an avatar from a different project, saved again, and this time the OpenGraph image was set correctly. Thinking there might be something wrong with the first PNG image, I set that again as the avatar.. but this just worked. There was nothing wrong with the image. Right now I can't reproduce getting the `-1` in the URL anymore, but looks like there may be a bug somewhere at play.
ashimokawa commented 2 weeks ago
Owner

@circlebuilder

https://codeberg.org/user/avatar/innercircles/-1 redirects to an avatar image which looks correct, when you tried what did you see as image? Or can it be an issue with the previewer expecting a .png or similar image format extension?

@circlebuilder https://codeberg.org/user/avatar/innercircles/-1 redirects to an avatar image which looks correct, when you tried what did you see as image? Or can it be an issue with the previewer expecting a .png or similar image format extension?
circlebuilder commented 2 weeks ago
Poster

Ah, okay. I did not see a onebox (as Discourse calls them) at all. Just the link as plain text in the post. Only after a custom avatar images was referenced in meta did it generate the onebox (had to test that on a different forum, as discourse caches oneboxes somehow, doesn’t regenerate on each meta change).

I don’t know about the latter re. previewer. Usually discourse has no problems with oneboxes from Codeberg URL’s.

Ah, okay. I did not see a onebox (as Discourse calls them) at all. Just the link as plain text in the post. Only after a custom avatar images was referenced in meta did it generate the onebox (had to test that on a different forum, as discourse caches oneboxes somehow, doesn't regenerate on each meta change). I don't know about the latter re. previewer. Usually discourse has no problems with oneboxes from Codeberg URL's.
circlebuilder commented 2 weeks ago
Poster

Just tested the links below on 2 different Discourse forums (one self-hosted and one not) and no onebox is generated, just the plaintext URL shows up in a post:

https://codeberg.org/innercircles

https://codeberg.org/innercircles/seedvault

The last URL is for the repo that has a custom avatar.

Just tested the links below on 2 different Discourse forums (one self-hosted and one not) and no onebox is generated, just the plaintext URL shows up in a post: https://codeberg.org/innercircles https://codeberg.org/innercircles/seedvault The last URL is for the repo that has a custom avatar.
circlebuilder commented 2 weeks ago
Poster

But this URL also for a repo with custom avator does generate a onebox on the same 2 forums: https://codeberg.org/teaserbot-labs/delightful-sustainable-business

But this URL also for a repo with custom avator _does_ generate a onebox on the same 2 forums: https://codeberg.org/teaserbot-labs/delightful-sustainable-business
circlebuilder commented 2 weeks ago
Poster

See the screenshot.

Codeberg OpenGraph issue

PS. Related. For Organization I’d expected not to see the Codeberg logo and description, but the organization logo + description.

See the screenshot. ![Codeberg OpenGraph issue](https://codeberg.org/attachments/e3dbc61c-d326-4d81-8602-7e3c89d012ff) PS. Related. For Organization I'd expected not to see the Codeberg logo and description, but the organization logo + description.
circlebuilder changed title from Issue with repository avatar icon to Issue with organization + repository avatar icon 2 weeks ago
circlebuilder commented 2 weeks ago
Poster

Comparing the metadata.

The entire <head> section of https://codeberg.org/innercircles is exactly the same as for https://codeberg.org/teaserbot-labs and the OpenGraph meta looks like:

<meta property="og:title" content="Codeberg.org">
<meta property="og:type" content="website" />
<meta property="og:image" content="/img/gitea-lg.png" />
<meta property="og:url" content="https://codeberg.org/" />
<meta property="og:description" content="Codeberg is founded as a Non-Profit Organization, with the objective to give the Open-Source code that is running our world a safe and friendly home, and to ensure that free code remains free and secure forever.">
<meta property="og:site_name" content="Codeberg.org" />

Maybe there’s a difference in the PNG’s, but I believe both were generated from Inkscape SVG’s (the innercircles logo might be generated from LibreOffice Draw)

Comparing the metadata. The entire `<head>` section of https://codeberg.org/innercircles is exactly the same as for https://codeberg.org/teaserbot-labs and the OpenGraph meta looks like: ```html <meta property="og:title" content="Codeberg.org"> <meta property="og:type" content="website" /> <meta property="og:image" content="/img/gitea-lg.png" /> <meta property="og:url" content="https://codeberg.org/" /> <meta property="og:description" content="Codeberg is founded as a Non-Profit Organization, with the objective to give the Open-Source code that is running our world a safe and friendly home, and to ensure that free code remains free and secure forever."> <meta property="og:site_name" content="Codeberg.org" /> ``` Maybe there's a difference in the PNG's, but I believe both were generated from Inkscape SVG's (the innercircles logo _might_ be generated from LibreOffice Draw)
circlebuilder commented 2 weeks ago
Poster

Hmm, OpenGraphTester says ‘Page not found’ for innercircles organization, but gives results for teaserbot-labs. And the same issue happens for the repository links.

Hmm, [OpenGraphTester](http://www.opengraphtester.com/test/) says **'Page not found'** for innercircles organization, but gives results for teaserbot-labs. And the same issue happens for the repository links.
6543 added the
gitea-related issue
label 2 weeks ago
6543 commented 2 weeks ago
Collaborator

Bug: “Open Graph dont user Org Avatars”

https://github.com/go-gitea/gitea/issues/12778

Bug: "Open Graph dont user Org Avatars" https://github.com/go-gitea/gitea/issues/12778
circlebuilder commented 2 weeks ago
Poster

Thanks for filing that issue.

But the “Page not found” for both a specific org page and a repo page indicates yet another issue is at play.

Thanks for filing that issue. But the "Page not found" for both a specific org page and a repo page indicates yet another issue is at play.
circlebuilder changed title from Issue with organization + repository avatar icon to Issue with organization + repo opengraph meta 2 days ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.