this post was submitted on 21 Jun 2023
35 points (97.3% liked)

Asklemmy

42523 readers
1518 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy πŸ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_[email protected]~

founded 5 years ago
MODERATORS
 

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 [email protected] that, when a user of bar.com clicks on it, opens https://bar.com/c/[email protected] instead of https://foo.com/c/some_community.

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

top 20 comments
sorted by: hot top controversial new old
[–] fubo 6 points 1 year ago* (last edited 1 year ago) (2 children)

Yes, you can do this using a relative URL!

Here's an example.

Here's how I wrote it:

[Here's an example.](/c/[email protected])

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 [email protected] 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/.

[–] el_doso 3 points 1 year ago (1 children)

Whoa, that's so cool!


And, man, that's a bummer.

[–] fubo 2 points 1 year ago

Trickery using URL features, like this, will work from clients that act like a web browser. Other clients may have problems with it. There should probably be a standard syntax for "a link to community X hosted on instance Y" that all clients can learn to support.

[–] sanguinepar 1 points 1 year ago (1 children)

Just FYI, this link...

...causes the Jerboa app to crash. I think it's a known issue and hopefully one that gets sorted, but just wanted to warn others.

[–] fubo 3 points 1 year ago

Wow, good thing to point out.

Relative URLs should work straightforwardly for a UI that runs in a browser, but yeah, I can imagine a custom app doesn't know what domain or even protocol to associate with them.

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

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

[–] melonpunk 4 points 1 year ago* (last edited 1 year ago) (1 children)

I'd like to know too. I was hoping it would be something simple like [[email protected]](/c/[email protected]) 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 [email protected]

EDIT2: Nope: That link goes to https://lemmy.world/post/[[email protected]](/c/[email protected]) for me, which is not valid.

[–] [email protected] 6 points 1 year ago (2 children)

That link crashes jerboa lol

[–] melonpunk 4 points 1 year ago

Tested it with Memmy and it states TypeError: Cannot convert null value to object. Nice.

[–] melonpunk 3 points 1 year ago

Fear my wrath!

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (2 children)

That's what this does:

[Some text here]([email protected])

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

blah blah blah links to [email protected]

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

blay harg vlar

[–] melonpunk 4 points 1 year ago

Resolves to https://lemmy.world/post/[email protected] and https://lemmy.world/post/[email protected] which are bad links.

[–] [email protected] 3 points 1 year ago

That's perfect! Thank you :)

[–] Perhyte 3 points 1 year ago* (last edited 1 year ago) (1 children)

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

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.

[–] [email protected] 1 points 1 year ago

Nice, thanks for the info!

[–] [email protected] 2 points 1 year ago

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.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

I thought it worked if you just linked /c/[email protected]
~~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/[email protected]

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.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

Kbin needs /m/[email protected] (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/[email protected] format is that it doesn't currently auto linkify. Gotta do [/m/[email protected]](/m/[email protected]) (/m/[email protected])

Hopefully kbin soon fixes the [email protected] syntax. It's currently broken. Once fixed, that should work for everyone.

[–] [email protected] 0 points 1 year ago (1 children)

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

[–] [email protected] 1 points 1 year ago

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.

load more comments
view more: next β€Ί