Dynamic Open Graph images for topics?

AI-generated summary

The discussion explores the idea of generating dynamic Open Graph images for Discourse topics, similar to Reddit or GitHub, to improve link sharing. jordan-violet initiates the conversation, seeking a way to create visually relevant previews for shared links, especially when no image is present. merefield clarifies that Discourse already uses topic-specific images or branding fallbacks, but jordan-violet explains the need for dynamically generated images based on topic content (title, category, tags, etc.) rather than static images. merefield acknowledges the request but expresses reservations about text-based images, suggesting it could be an optional feature. jordan-violet confirms the community’s interest, citing better click-through rates in enterprise settings. jimkleiber expresses enthusiasm, noting that current generic previews are unhelpful. jordan-violet reveals that while dynamic images are not yet implemented, work is underway. They highlight a related improvement: dynamically setting og:title and og:description for tag pages, which enhances the community’s professional appearance. jimkleiber appreciates this progress. Finally, jordan-violet shares a meta.discourse.org post announcing the feature’s development, crediting @gabriel.

I’ve seen a few disparate topics related to this subject, but I’d be curious to know if there has been any consideration for generating dynamic Open Graph images for topics similar to Reddit.

When links to my community are shared, I’m thinking about the best visual to represent all links and it can be hard. Should it be a CTA to join? Preview of what’s inside? Something generic that just shows the name of my community? I think all are good answers…depending on the link being shared.

Solving at least for question #2, it would be great if Discourse would dynamically generate the Open Graph image for the topic that was a preview of the topic (e.g. title, category, tags, maybe user profile picture, etc.)

3 Likes

What do you mean by “dynamic”? The thumbnails are already sent depending on the Topic contents.

When I share a Topic from my forum, the Open Graph thumbnail shows the image associated with that specific Topic (if one exists) and if not it will use the graphic from the branding Settings as a fallback.

Here are examples of both, one without a Topic thumbnail, and one with:

This works out of the box.

2 Likes

Great clarifying question! This would be for topics without images, and also where you don’t want images to be the default used.

Here’s some examples of what a Reddit link looks like when a link to a specific comment is shared, for example. I would assume these are generated dynamically, creating Open Graph images that are directly relevant to the content being shared (e.g. in the case of Discourse, a topic title, category, tag, etc. or for a post, possibly an excepert, their username, the category, etc.)

2 Likes

Thanks! I understand more about you want now.

Well as you can see, the preview excerpt text is already included (whether or not you have images)

You are proposing having thumbnails auto-generated to depict the text of the conversation including elements of the interface.

That would currently be a duplication of sorts?

I’m not a great fan of text as images, but that’s me.

But for sure, maybe we could have that added as an option?

3 Likes

For sure. Specifically, generating an appealing Open Graph image to be used as the og:image url.

Ah yes, we all have our ideas! I find our community is looking for something like this (which I agree with) and I see much better click-through rates on these in the business/enterprise world versus random images.

It would be great to have a framework for generating these in Discourse, similar to GitHub’s approach:

4 Likes

Any updates on this?

I was just thinking how much I’d love this as a way to generate interest when sharing on Whatsapp/Twitter/IG/LI/etc, so that with just a sharing of a link, people 1) know a conversation is happening and 2) might switch from conversing on the social media platform to the Discourse forum.

Or anyone have any ideas on how hard this would be to create?

2 Likes

We’re having some work done on this—will share it once it’s done :slight_smile:

3 Likes

Very excited to hear how it goes. I shared a pre-filled new topic link to a friend on Signal and it just gave the generic image and description of the community, which I find to be so unhelpful that I just deleted the share image.

I hope this comes to fruition soon, as I think it’ll provide so much visual context to people before visiting :crossed_fingers: :slightly_smiling_face: :crossed_fingers:

1 Like

Discourse should be open-sourcing something soon. We decided not to add the feature for dynamic images yet, but you can define the title and description dynamically for a route. For example, we now have this tag page, but look!

We overrode the og title and description. Much better than if it said something like this (if you could imagine it saying “Topics tagged product-announcement”).

It’s such a small detail, but it really makes a community (at least in the enterprise) feel significantly more polished and robust!

3 Likes

Yes, this will make me very happy :blush: . While images would be fancy, i think this would more than suffice. Very excited for it, thanks for the work!

1 Like

Here you go!

Huge thanks to @gabriel for making it happen!

3 Likes