Allow Title-Only Onebox

:information_source: Summary Enables title-only oneboxes
:hammer_and_wrench: Repository Link https://github.com/dsims/discourse-onebox-title-only
:open_book: Install Guide How to install plugins in Discourse

Feature

If a linked webpage is missing description or image metadata, Discourse will normally leave it as a URL and not onebox it. This plugin changes that behavior to allow for title-only oneboxes.

Example:

becomes
Screenshot 2025-02-24 at 10.02.36 PM

12 Likes

Cool, thanks for writing and publishing the plugin.

Maybe we should adopt this in core? Seems like a better default to me.

7 Likes

The description requirement was actually removed at one point (way back when it was a standalone gem) but then it was reverted a few months later, so I assume there was some reasoning not to do it.

I have only seen a handful of URLs in the wild that match this scenario, so I imagine there are some edge cases where it doesn’t look right.

2 Likes

@dsims it’s not clear at all why this behaviour of allowing oneboxes with no descriptions was backtracked here FIX: do not show title only oneboxes by arpitjalan · Pull Request #448 · discourse/onebox · GitHub , so we will just add this behaviour back into core, no need for a plugin. Will try for a quick PR today for this.

5 Likes

PR is here:

8 Likes

One thing I did not address is that the composer preview still has a message implying that there is an issue generating the onebox.

5 Likes

Ah thanks for letting me know, I didn’t see this because I posted too fast when testing. Fixing in the same PR…

5 Likes

Thanks! World’s fastest deprecated plugin? :joy:

9 Likes

6 Likes

Awesome, thanks for the plugin @dsims, its short-lived life served a purpose, it led to a fix in core (with benefits for all).

And thanks for the quick adoption in core @martin!

8 Likes