this post was submitted on 19 Jul 2023
5 points (100.0% liked)

Lemmy App Development

762 readers
8 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 2 years ago
MODERATORS
 

Is there anywhere that lemmy's various types of internal links are documented? like !community links @user links, links of the form https://lemmy.com/c/community@otherinstance.net. i have also seen links that just have "/c/community@otherinstance.net"... at the moment i'm only developing rendering code for them as i happen upon them, which is ad-hoc

top 4 comments
sorted by: hot top controversial new old
[–] marsara9@lemmy.world 2 points 2 years ago (1 children)

I don't know of any documentation off the top of my head but currently there's

User links: @marsara9@lemmy.word

These will translate to https://<your instance>/u/marsara9@lemmy.world assuming your not on lemmy.word. If you are it will just be https://lemmy.word/u/marsara9.

And community links: [!fediverse@lemmy.world](/c/fediverse@lemmy.world)

These will follow the same pattern but will have /c/ instead of /u/.

There's been proposals to add others but that's all that exists at the moment.

[–] blawsybogsy@lemmy.ml 1 points 2 years ago (1 children)

thanks for clarifying, so i guess my other link type is an error on my end somewhere...

[–] marsara9@lemmy.world 2 points 2 years ago (1 children)

The one that begins with https is obviously just a full URL and will take the user directly to that instance rather than staying on their home instance. And the one that starts with /c/ is a relative path. While it might work, if the community/user it points to is on the same server as the user, they might encounter errors as it might try and navigate to https://lemmy.world/c/fediverse@lemmy.world which is undefined (may or may not work).

[–] blawsybogsy@lemmy.ml 1 points 2 years ago

yeah, the relative ones are always on another instance it seems. if you strip the '/c/' you can hit the '/community' endpoint with the 'comm@inst.ance' part as the name parameter and it returns the community_view for it. works fine.