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

Asklemmy

43503 readers
1867 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?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 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.