slmnio / slmngg-sfc

New SLMN.GG website & server
5 stars 8 forks source link

Use aliases and custom slugs for more URLs #58

Open slmnio opened 3 years ago

slmnio commented 3 years ago

We use slugs for the news items, but we could do with using more for other items, such as players.

https://slmn.gg/player/drayton/casts looks so much better than https://slmn.gg/player/l48vZoVPzBV5xK/casts.

A redirect from /talent/{name} to /player/{id} could be a good first step (or good to have in general - bios with slmn.gg/talent/jace would look great and encourage use.

The main thing to work out is the best way of remapping requests like that into IDs. At the moment, we hack it using stuff like event-${event.subdomain} as an ID. Realistically, a request with a slug should return some sort of flag to say "hey this is actually this data with this ID, rather than the current solution where the code thinks that event-bpl and the actual ID is different data.