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

Remove logo from Open Graph previews #4073

Open
1ec5 opened this issue Jun 28, 2023 · 4 comments
Open

Remove logo from Open Graph previews #4073

1ec5 opened this issue Jun 28, 2023 · 4 comments

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 28, 2023

Every page has an Open Graph preview that includes the OpenStreetMap logo as the og:image. Most sites set this meta tag to an image that represents the specific object, not the site as a whole. When a page-specific image is unavailable, they just omit the meta tag. OSM should also omit the og:image tag until we’re able to fill it in with something more meaningful for #2965.

I like the OSM logo. However, using it as the object’s image causes some Open Graph clients to display the OSM page less than ideally. Discourse and Slack already include the favicon automatically, making the image redundant. Slack displays the image at full size, dominating the preview as if it’s the most important element. (OSMUS Slack specifically disabled previews for anything on openstreetmap.org in 2016 because it got so obnoxious.)

It’s not at all uncommon for sites to omit og:image – the OSM Wiki omits it, for example. If we do need to keep the logo for branding reasons, can we at least shrink it to match a more typical size in link previews?

Screenshots

Open Graph Preview has mockups of more websites.

Discord

Discord

Discourse

Discourse

Facebook

Facebook

In some contexts, Facebook shows a variation of the preview that stretches the image to be as wide as the preview, which causes the logo to look quite blurry.

Mastodon

Mastodon

Slack

Slack

Telegram

Telegram

Twitter

Twitter

Implementation notes

This would be just a matter of removing these lines:

"og:image" => image_url("osm_logo_256.png", :protocol => "http"),
"og:image:secure_url" => image_url("osm_logo_256.png", :protocol => "https"),

/ref #2007

@tomhughes
Copy link
Member

This is basically a duplicate of #2007, #2965 and probably others.

The current tags were added because people asked for them and I'm reluctant to remove them entirely.

Obviously if we could provide a better image in some cases that would be great but it's hard to achieve.

@tomhughes
Copy link
Member

tomhughes commented Jun 28, 2023

Specifically openstreetmap/iD#1644 was the trigger for the image.

@1ec5
Copy link
Contributor Author

1ec5 commented Jun 28, 2023

Specifically openstreetmap/iD#1644 was the trigger for the image.

Thank you for the context. 👍 It looks like the image in openstreetmap/iD#1644 (comment) broke at some point, but based on the description in #446, the issue seems to have been specific to Facebook’s default presentation. In the absence of an og:image, Facebook apparently searched the page for another largeish image and found the ad for State of the Map Birmingham that was added in #268. The ad was removed in #476, but I think the current banner mechanism would still be affected, since it’s static content.

Stack Overflow is awash in questions about how to hide specific images from Facebook’s link sharing function, but at a glance, all the answers sound like tagging for the renderer.

@1ec5
Copy link
Contributor Author

1ec5 commented Jul 15, 2023

The ad was removed in #476, but I think the current banner mechanism would still be affected, since it’s static content.

Does the welcome/event banner need to be static HTML? The only benefits I can see are that it also appears to users with JavaScript disabled (who get an inoperable slippy map anyways) and potentially helps a little with SEO, maybe. But if we convert it to a little bit of JavaScript that inserts it into the DOM, then any image in an event banner will be invisible to Open Graph clients, which only look at static HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants