Post Sharing - ability to convert the URL to the short version

Hey wonderful Discourse community!

As you are all aware, there is an existing feature to share a post.

When this share button is pressed, a pop-up appears and looks like:

image

The full link provided in the image above is:
https://meta.discourse.org/t/how-should-short-links-be-supported-in-discourse/15339/22

Notice how long this link is?


Why is this a problem?

  • For some topics the slug can be so long that the shared URL wont even fit within the maximum character limit for some social media platforms. This has a negative impact on the community sharing form posts outside of the forum on social media to generate additional forum traffic.

  • Some social media platforms don’t allow clickable links or even copying text. So users need to manually type out the URL to access the link. Having a super long link increases the chances of a mis-click on the keyboard resulting in a broken link.

  • It looks messy sharing super long links.


There is already a manual solution
There is a feature already built into Discourse which allows you to replace the slug, with a dash, and the link will still work. Both of these links go to the same place. But the first one is drastically shorter.

https://meta.discourse.org/t/-/15339/22

https://meta.discourse.org/t/how-should-short-links-be-supported-in-discourse/15339/22


My proposal is

A) Update the share post pop-up to replace the existing (long URLS containing slugs) with short-links (slugs replaced with “-”).

B) By default enable short-links (slugs replaced with “-”) include a button on the share post pop-up screen that lets the user choose the URL type (long or short).

C) A site setting for site admins to enable or disable based on their preference of a global setting for sharing URLs.


What are your thoughts?

1 Like

No need to use the - :

https://meta.discourse.org/t/15339/22

:slight_smile:

A checkbox in the sharing pop-up to transform the link into a short version could be a nice addition:

image

5 Likes

Which ones will count that limit more than using theirs standard amount for all links? Not Twitter or Mastodon AFAIK.

Short links are quite no-no nowadays because users don’t see the target.

2 Likes

Can you please try to be a little less ambiguous here?

Twitter for example substitutes all URLs with a shortened t.co link for the purpose of click tracking. They present the original URL in the interface, but all tweets take up 23 characters from the maximum.

1 Like

From my experience, I encountered numerous times forms on websites that had ridiculously and arbitrarily short character limits.
Especially on companies’ or administrations’ websites. Kind of as if they didn’t really want to read a detailed message, request, or complaint from customers or anyone concerned by their services… :upside_down_face:

Though I admit that in my everyday life, I usually don’t encounter issue with long links (and it’s hard to call a Discourse link a “long” link, they don’t have endless query parameters).

It could be a good candidate for, I suppose, a fairly easy theme component.

3 Likes

@UnitedFreedom, you can try this theme component, let me know if you encounter any issues:

12 Likes