Slugified URLs

From neuromatch


sneakers.the.rat#technical-wg23-10-06 21:45:39

So idle thought, i saw someone whose instance had Slugified URLs for posts, ( eg. /my-post-title ) And it looks like it would be pretty easy to do... - add a `slug` db column in the statuses table - add a route using `slug` - add a field to the status composer component to optionally add a slug, which would need to validate for correct formatting and uniqueness (eg. Show red outline with message when slug is already used, disallow spaces and other non URI chars) - add API endpoint to check if slug exists - add button in "share" dropdown to copy slugified link - optionally: provide an auto-slug option that slugifies the first n unique characters in a post, or parses a leading # header

That would be for adding them as an additional ui thing, rather than changing the representation of the AP objects/etc. ID URL would remain canonical, slug would be useful for sharing, and also if we want to allow posts to behave more like pages (eg. Set custom page CSS for an `Article` type vs the usual `Note` ) for a future rich text editor hack that makes masto both micro and macro blog