Share Link Shortener

:information_source: Summary Adds a checkbox in the share link modal that replaces the share link with a shorter version containing only the IDs of the topic and post.
:eyeglasses: Preview Share Link Shortener preview
:hammer_and_wrench: Repository https://github.com/Canapin/short-share-link/
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This theme component adds a checkbox to the share link modal that replaces the share link with a shorter version containing only the IDs of the topic and post.

You can translate “Short link” in the theme component’s settings.

short link toggled off

short link toggled on

In action:


:information_source: This feature was requested here: Post Sharing - ability to convert the URL to the short version

16 Likes

That is pretty sweet! Thanks for making this!

2 Likes

Thank you so much for making this very useful plugin <3

3 Likes

I noticed a slight issue. The checkbox creation prevents the link text input content from being selected by default, and unfortunately, I don’t know how to fix it…

That’s a minor issue though. :slight_smile:

Shouldn’t the shortened link also include slug placeholder like this:

https://meta.discourse.org/t/-/251965/4

I’m pretty sure there used to be issues when linking to the forum from external sites using the shortened link without the slug?

I’m not aware of these issues.

I remember seeing the formatting without any slug in a piece of official code yesterday or the day before… I don’t remember where but I thought “how, they use the syntax without the /-/ here” which seemed to be a clue that such URLs seem to be fine. :thinking:

If you happen to find a link about potential problems, that would be great :+1:

1 Like

Thanks!

Either I’m not understanding the issue, or it’s not happening anymore. :slight_smile:

Clicking https://meta.discourse.org/t/1 opens the right topic seamlessly and allows you to go back to the previous URL.

No issue either with external links: https://unicyclist.com/t/265354/2608

1 Like

That link ia almost 2 years old now. I imagine that may have been fixed up since then.

If you look at the op statement it was more about a post number.

The top link has /1 where as the other just ends in / so no post number in the link

(Share Link Shortener) This link goes to post #1 in this topic.

https://meta.discourse.org/t/251965/1

(Share Link Shortener) This link has no post number.

https://meta.discourse.org/t/251965/