Install this theme component
This theme component is especially useful when sharing Discourse links on platforms that limit the maximum number of characters in a message, like Twitter or Mastodon.
remember preference: Remember if the user prefers shorter links using their browser’s local storage.
short_link_label: The toggle label, set to “Short link” by default.
Screenshots & video
This feature was requested here: Post Sharing - ability to convert the URL to the short version
That is pretty sweet! Thanks for making this!
Thank you so much for making this very useful theme component <3
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.
Shouldn’t the shortened link also include slug placeholder like this:
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.
If you happen to find a link about potential problems, that would be great
Either I’m not understanding the issue, or it’s not happening anymore.
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:
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.
Share Link Shortener) This link has no post number.
You can add more customization to use external shortlink systems, for example I am currently using yourl source code to set-up a website that supports shortlink is
I loved so much what you did
but I needed to put an icon next to the date
to signal to users that they can click
How do I put an icon there?
This suddenly stopped working on my site (to be honest I have no idea when, I don’t use it frequently) but just noticed now it’s not appearing on any of my themes though it’s still enabled on all of them. I know that provides no useful information lol, but any idea?
After upgrading to the latest version of Discourse, I confirm the component doesn’t work anymore.
I’d need to have a look at the recent Discourse commits.
It’s a very simple theme component, so if someone wants to have a look and do a PR, it’s also welcomed.
This seems like a useful component, so I’ve fixed it and added some updates here:
08:25PM - 18 May 23 UTC
This refactors the component so it works again and uses Ember's Glimmer componen
The theme component has been updated and is now
There’s a new setting as well described in the first post.
I’ve been using Mastodon recently on an instance with limited character numbers, so that might be useful here indeed.
Shoud these two shares, topic and post, work similar way?
Interesting, kind of. An error opens sharing of iOS instead. Well, not sharing-sharing actually, but this pop-up:
After trying again, it doesn’t trigger any error anymore.
I’m not sure what the issue was.
I don’t know anything about errors, but I get different view, and I don’t know if it should or should not be that way.