3 ms·
This is a cool site, though I did notice something that I haven't seen anywhere before: the URL paths are JSON objects. Is there a reason for this? For example,
by Minor49er 6y ago
This is a cool site, though I did notice something that I haven't seen anywhere before: the URL paths are JSON objects. Is there a reason for this? For example, for "The Call of Cthulhu", the URL is this:
https://www.typelit.io/chapters/%7B%22bookTitle%22:%20%22The%20Call%20of%20Cthulhu%22,%20%22displayTitle%22:%20%22The%20Call%20of%20Cthulhu%22,%20%22language%22:%20%22English%22,%20%22bookId%22:%20%225f468ca35e91c10be0883a57%22%7D https://www.typelit.io/chapters/%7B%22bookTitle%22:%20%22The...
Why not just use this?
https://www.typelit.io/chapters/5f468ca35e91c10be0883a57/The-Call-of-Cthulhu https://www.typelit.io/chapters/5f468ca35e91c10be0883a57/The...
Also, the JSON object is fault tolerant and will display whatever you want for a title, even if there isn't a book available:
https://www.typelit.io/chapters/%7B%22%64%69%73%70%6C%61%79%54%69%74%6C%65%22%3A%22%57%68%61%74%20%69%66%20%42%69%6C%6C%20%47%61%74%65%73%20%68%61%64%20%61%20%64%69%6D%65%20%66%6F%72%20%65%76%65%72%79%20%74%69%6D%65%20%57%69%6E%64%6F%77%73%20%56%69%73%74%61%20%63%72%61%73%68%65%64%3F%20%4F%68%20%77%61%69%74%2C%20%68%65%20%61%6C%72%65%61%64%79%20%64%6F%65%73%21%20%42%74%77%20%74%68%69%73%20%69%73%20%6E%6F%74%20%61%20%62%6F%6F%6B%20%73%6F%20%69%74%20%68%61%73%20%6E%6F%22%7D https://www.typelit.io/chapters/%7B%22%64%69%73%70%6C%61%79%...
- whiddershins 6y agoThis comment can’t be read, perhaps use code block formatting, or remove the http and domain info, so we can see what you mean? The link is getting truncated when it displays.
- SamBam 6y agoThose links are over 200 characters long, and just look like escaped JSON, so I don't think it would help much. You could just click on them if you really wanted to know the details, but I think the question is pretty clear regardless.
- Minor49er 6y agoThat's a fair point. I was expecting people to click or hover the links to see the examples, but for really showing how the paths are formed, this would make sense to do.
- Octouroboros 6y agoHey I'm glad you asked! It's the way Nextjs handles urls with more than 1 param. If I prettify the URL then for some reason the page can't access them. Don't know if they've improved on it yet (or, who knows, maybe I'm just using it wrong) but it'll be fixed eventually.
- SamBam 6y agoThe URL parameters are: {"bookTitle": "The Call of Cthulhu", "displayTitle": "The Call of Cthulhu", "language": "English", "bookId": "5f468ca35e91c10be0883a57"} Why do you need all the others besides "bookId"? Changing "bookTitle" and "language" don't seem to do anything. Changing "displayTitle" does change the displayed title, but why can't you get that using the bookId?
- Minor49er 6y agoThat's interesting. Thanks for pointing me towards Next.js. I wasn't aware of that framework, but I'm checking it out.
- technoplato 6y agoSuper cool framework that is only getting better. If you’re interested in framework spelunking-check out Remix by Ryan Florence and Michael Jackson (no, not that one...). It’s actually going to be paid but I’m very excited to try it. It handles some data loading pain points among others that seem very interesting.
- roryokane 6y agoLink to the mentioned framework “Remix”: https://remix.run/ https://remix.run/
- cambalache 6y agoThat is just an email collecting form. Astroturfing?
- 6y ago