LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
12.98k stars 862 forks source link

Community name in post URL #875

Open joppuyo opened 4 years ago

joppuyo commented 4 years ago

Right now if you have a post in the Announcements community, the URL will be https://dev.lemmy.ml/post/29441 and in the Linux community, it will be https://dev.lemmy.ml/post/36351 .

Would it make sense to include the community name in the URL, for example, https://dev.lemmy.ml/announcements/post/29441 and https://dev.lemmy.ml/linux/post/29441 so when you see a Lemmy URL you see right away which community it belongs to?

Maybe you could even have the /c/ at the beginning of the post path to further emphasize that the URLs are hierarchical?

dessalines commented 4 years ago

It might makes sense for the semantic web, but IMO it really doesn't add that much value... look at how silly this type of thinking has gotten w/ reddit: https://www.reddit.com/r/aww/comments/glenz4/cute_baby_bunnies_think_the_golden_retriever_is/

Its gotten to reddit/community/comments/post_id/weird_lengthened_post_name, when it should be just reddit/post/postid

joppuyo commented 4 years ago

On the contrary, I find the Reddit link to be highly readable, even without clicking it, I can see that it's a link to a subreddit called Awww and it's probably a picture of a cute dog. Something like https://reddit.com/post/3ocelxb1w84zvseyz1elglzzq wouldn't tell me anything about the content of the post or where it has been posted.

In my opinion, having the community name in the URL comes down to whether you think of Lemmy as a "one thing" where all the content of one instance is located under it or whether you think each community is "its own thing" so posts should be scoped under it.

But yeah, I think this is just my own musings. I think the current URLs are fine but they could be even more descriptive.

MasterOfTheTiger commented 4 years ago

I believe the communities are considered to be "one thing", since they are groups that can span multiple instances.

Nutomic commented 4 years ago

If we make this change, we should do it before releasing federation. After that it will get much harder to change the URLs.

ceeim commented 4 years ago

I think it's necessary to keep the URLs simple and not change the links to the pages even after the content is changed, which is good for SEO. And if it's an international community, people don't care if the URL contains an introduction, because maybe they use a translation.

joppuyo commented 4 years ago

@ceecx I don't think a post URL slug is a necessity, I think community name would be more important. Is it possible that a community is renamed thus invalidating all the URLs pointing to posts in that community?

On second thought I think the IDs are sequential per instance and not community so in theory, if communities are rename-able, the post URL could be routed http://${instance}/c/${community}/${post_id} where the community could be any string.

Like in Stack Overflow where https://stackoverflow.com/questions/62882265/date-parsing-without-considering-timezone-javascript and https://stackoverflow.com/questions/62882265/you-can-have-anything-here-but-it-still-works lead to the same post.

dessalines commented 4 years ago

In this case we might be able to do some url redirects, which just completely ignore the community name anyway. IE instance/c/anything/post/1 and instance/post/1 go to the same place.

But that way all the federated urls can still be the same.

loid345 commented 2 years ago

SEO Links very useful for promotion

mpeter50 commented 1 year ago

This suggestion would be very useful. I usually consider myself a power user, but coming from reddit, links to posts and comments are very confusing without the community name and the post title. Where will I end up? What is that link about?

Technically they could be optional (both the community name and the post title, but verified when given that they are correct) similarly to how reddit does it too, but the clients should be encouraged to primarily give this extended URL to the user when copying and such.

And as said above, this could just be a redirect, or even better an alternative URL ("in-backend redirect") so that the readable URL is kept visible on the address bar of the browser.

ZeusOfTheCrows commented 10 months ago

just want to add that kbin does this, e.g.:

https://kbin.social/m/imaginarywarhammer@lemmy.world/t/247807/Emperors-Palace-by-Richard-Wright

now i'm not saying lemmy should emulate kbin in most ways, but i think this leads to much more readable urls

makeasnek commented 10 months ago

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Please do not use bountysource. Many devs have had trouble getting paid there. You can check out this lemmy community as an alternative https://lemmy.ml/c/bugbounties

For statements from devs who have been unable to cash out from bountysource see: https://github.com/bountysource/core/issues

mpeter50 commented 10 months ago

now i'm not saying lemmy should emulate kbin in most ways, but i think this leads to much more readable urls

Yes, I also think that adopting this wouldn't count as just copying, the real point here is not that others are doing it this way.

The real point is that Reddit and Kbin are doing it because it is significantly more user friendly. You know upfront what (kind of content) to expect at the other side of the link, and that helps with understanding context when you read comments where people link around other posts. Also, to me it seems this way its also easier to load the exact same post and comment chain at the provider where you have registered, because you just need to rewrite the domain at the front.

For statements from devs who have been unable to cash out from bountysource see: https://github.com/bountysource/core/issues

Wow, thats.. interesting. At the same time I'm surprised they are not deleting those issues.

I'm mentioning @dessalines so that they see that their attention is needed. If you are reading this, only the previous comment by makeasnek is relevant regarding the bountysource issue. The first part of my comment is on the topic of this issue.

dessalines commented 10 months ago

I don't have time to work on something like this, but feel free to add it.

mpeter50 commented 10 months ago

@dessalines I understand and thats ok, but the reason I mentioned you is a different one. It is about bountysource.

Apparently people are not getting their bounties with it for a long time. I'm not sure if its some or all of them.. but from the issues it seems its a long time problem and bountysource does not react on it. Last commit there was 2 years ago, bountysource looks like as if it was abandoned. This may affect the whole project, by new contributors getting disappointed that they cant claim the bounties for their work.

The comment of makeasnek contains some references to more info

dessalines commented 10 months ago

@mpeter50 Okay I've now denied bountysource priveledges on the LemmyNet org. No one used it anyway.

jcklpe commented 8 months ago

Want to express support for this. Also there's some good discussion on the topic here: https://lemmy.ca/comment/4525235

pixiekat commented 8 months ago

Readability issues aside, it's also good for security so people have a general idea of the type of content you can expect if you were to click on a link instead of just slash post slash numbers.

Die4Ever commented 8 months ago

Readability issues aside, it's also good for security so people have a general idea of the type of content you can expect if you were to click on a link instead of just slash post slash numbers.

Steam recently added the name of the game into the URL instead of just the ID number, probably for the same reason.

llagerlof commented 8 months ago

Community name and the slug of post's title should be part of the link.

pmarks-net commented 8 months ago

Note that search results are also missing the community name: https://sh.itjust.works/search?q=banana&type=All&listingType=All&page=1&sort=New

paulo-roger commented 6 months ago

I think keeping both formats is the best.

The current url format work like a shortlink. The complete url though is great for all the reasons exposed above.