Example: for article titled "this is my example" I should be able to access that article by a human readable URL such as mysite.com/article/this-is-my-example
I spent several hours trying to implement this myself but I can't work out how to query Json values properly in this environment 😅
Hey, so here is my take on this:
I want notes and articles to have the same ID/URL, and it's hard to make a meaningful slug for notes.
But, I agree that for articles it would make sense, what about having the URL for article to be:
/o/{uuid}/{slug}
?
That makes sense. It's just such a long uuid though, makes for an ugly looking URL
My plan was to make an additional alternate endpoint so that /o/{uuid} would still work but /article/{slug} would be another option for humans
Ok I see your point.
I like the idea of having at least a part of the ID to prevent having to handle duplicate slug.
Would having
/articles/{id[:7]}/{slug}
be a reasonable compromise to you?I think a good plan could be:
- add a new slug field + migration to backfill it for existing article
- allow the UI to provide a slug (optional), will default to the "slugified" title
- setup a 301 redirect when
/o/{uuid}
is requested with HTML to/articles/{uuid[:7]}/{slug}
Later on, I think we could allow notes to have a slug too and have a
/notes/...
URL to for the HTML version.i will try to start tacking this now.
yeah that all makes perfect sense to me
I just pushed a first update that implements most of it, the only thing missing is the custom slug, I will push that later.