qpixel
qpixel copied to clipboard
Support URL slugs for categories
https://meta.codidact.com/posts/283564
From the meta post:
Currently, we pass an ID in urls for the category and tag routes. For instance, the Q&A category on this meta site has an ID of 3.
In the long term, this makes it harder for people to access content. For instance, a user can't navigate to (Codidact meta)/categories/3/tags/status-completed to see posts that have the status-completed tag, but instead have to look up the tag in search, know its id is 377 and substitute that in.
Could we please consider including one or more of the below features in QPixel?:
-
Add an option in category settings to allow setting a "slug" for that category, and let people access a category with its corresponding "slug". Potentially add the "slug" automatically for the currently seeded categories per site.
-
Allow users to access tag routes in a category by their name, or a properly escaped version of it (example in my paragraph above).
Tags seem like a bigger lift -- we'd have to normalize them, people would have to know how to normalize them, and it might be complicated (don't know). There are many tags, and especially once non-ASCII characters are in play, who knows what might happen?
But categories are more limited, and there's already a bunch of category-specific configuration, so there's a place to put it. We would still need a way for people to find out what it is -- it'd be great if we used the slugs in our own URLs, so clicking on (say) the Meta Q&A tab would take you to meta.cd.com/qa instead of to meta.cd.com/3.
I'm creating this issue so we don't lose track of it, and I'm marking it as needing analysis because we should probably address some of these open questions before diving into code.