Is there a way to make instance-agnostic links?

Is there a way to make a link to a community of a foreign instance that opens on the instance of the user that clicks on it?

For example, I would like to make a link to !some_community that, when a user of bar.com clicks on it, opens https://bar.com/c/some_community@foo.com instead of https://foo.com/c/some_community.

If it's not possible, don't you think it would be convenient?

Perhyte,

Once your Lemmy web frontend upgrades to version 0.18, the following should all auto-link with no extra syntax:

  • !community
  • /c/community@server.com
  • /m/community@server.com
  • /u/username@server.com

These should then all link to the instance you're currently on.

Note: because this is implemented in the frontend and does not change the underlying data, other Fediverse clients will not show these the same unless they also implement this themselves.

TomViolence,

Nice, thanks for the info!

jrubal1462, (edited )
jrubal1462 avatar

I thought it worked if you just linked /c/asklemmy@lemmy.ml
With the only caveat being that users on kbin will need /m/asklemmy.ml
With the only caveat being that users on kbin will need /m/asklemmy@lemmy.ml

I would normally test the crap out of these before posting since I really don't know what I'm doing, but I'm on my phone and mostly busy at the moment. Sorry if it doesn't work.

CoderKat,
CoderKat avatar

Kbin needs /m/asklemmy@lemmy.ml (domain is important) or a bit simpler is with an @ symbol in front: @asklemmy (note: the domain is here but kbin currently renders it without the domain -- that needs to be changed as it has potential to confuse and mislead)

Downside to the /m/asklemmy@lemmy.ml format is that it doesn't currently auto linkify. Gotta do [/m/asklemmy@lemmy.ml](/m/asklemmy@lemmy.ml) (/m/asklemmy@lemmy.ml)

Hopefully kbin soon fixes the !asklemmy syntax. It's currently broken. Once fixed, that should work for everyone.

aebrer,
aebrer avatar

Weirdly enough on kbin.social for me /m/asklemmy.ml link in the post worked for me

jrubal1462,
jrubal1462 avatar

I'm the problem. As feared I fudged it up as I was rushing to type it up on my phone. As @CoderKat mentioned, the problem with typing it out as /m instead of using @, is that you have to manually enter the visible text in [ ] and the hyperlink in ( ). I got the hyperlink correct and beefed it on the visible text.

jrubal1462,
jrubal1462 avatar

Sweet, I didn't know you could shorthand it with just @asklemmy and it would auto-linkify. Thanks.

ChemicalRascal,
ChemicalRascal avatar

An outstanding problem, though, is linking to specific posts and comments. And, after that, I would argue both kbin and Lemmy should support more nuanced parsing of cross-instance hyperlinks, to reduce friction and UX pain without requiring users to memorise new syntax just to make links work.

fubo,

Yes, you can do this using a relative URL!

Here's an example.

Here's how I wrote it:

[Here's an example.](/c/asklemmy@lemmy.ml)

Because this URL doesn't have a protocol or a domain, your browser fills those in from the URL of the page you're on when you see it. Since that's on your local Lemmy instance, you'll see a link to !asklemmy on that instance.

Also: When you're looking at a Lemmy comment, if you don't know how the author wrote the markup for it, you can use the "view source" button underneath the "..." menu.


Note: These links will NOT work between Lemmy and Kbin, because Kbin uses /m/ instead of /c/.

fennec,

Yes it would be very convenient, right now if I’m recommending a community I simply write out the URL manually to make sure it routes via the respective user’s instance first.

Catsrules, (edited )

Edit Sorry I misunderstood. I believe you can link the community as a whole, but posts I don't believe you can.

There isn't a way at the moment. Solutions to this are being discussed on Github

https://github.com/LemmyNet/lemmy-ui/issues/1048

Edit 2

~~Maybe you can't link a community either, I could have sworn I have seen it done but that could have just happened to be for my instance. ~~

Edit 3

My testing please ignore :)

Test1

Test 2 /c/asklemmy@lemmy.ml

Edit 4

This is how to link communities.

[My text here] (/c/asklemmy@lemmy.ml)

You need to have the /c/ or it won't work.

boomboxnation, (edited )

That's what this does:

[Some text here](community@instance.here)

Tap the 'more' skinny hamburger menu just above below this message to 'view source' of the below:

blah blah blah links to asklemmy@lemmy.ml

Actually..better, here is one for an instance that is neither yours or the one you posted into:

blay harg vlar

TomViolence,

That's perfect! Thank you :)

Willie,

Both of those links send me back to this post on lemmy.ml, through kbin, so if that is the end goal, then it worked.

Edo78,

On my instance ( feddit.it ) I see two broken links:

both return 404: couldnt_find_post

gingerman,
@gingerman@lemmy.ca avatar

Should these links work? I'm viewing this thread from Lemmy.ca and both give me a 404 error. When testing with jerboa, the app crashes

melonpunk, (edited )
@melonpunk@lemmy.world avatar

I'd like to know too. I was hoping it would be something simple like !community@host.com which would resolve for everyone. Didn't work when I tried it, though I might not have done it correctly.

EDIT: I guess I could try again here !asklemmy

dill,
@dill@lemmy.one avatar

That link crashes jerboa lol

  • All
  • Subscribed
  • Moderated
  • Favorites
  • asklemmy@lemmy.ml
  • khanakhh
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • osvaldo12
  • mdbf
  • Youngstown
  • cisconetworking
  • slotface
  • rosin
  • thenastyranch
  • ngwrru68w68
  • kavyap
  • ethstaker
  • JUstTest
  • tacticalgear
  • modclub
  • cubers
  • Leos
  • everett
  • GTA5RPClips
  • Durango
  • anitta
  • normalnudes
  • provamag3
  • tester
  • megavids
  • lostlight
  • All magazines