Creating Custom URL Routes in Sapper/Svelte like Next.js
Last updated: Apr 29, 2020
Question for those familiar with Svelte/Sapper and Next –
Sanity’s Next.js starter allows you to define custom URL routes in the Studio, and associate pages to these. Is this also possible using Sapper or is it a special ability of Next? Thanks
Apr 28, 2020, 1:00 PM
- It looks like you did a lot of the heavy lifting on both the Next and Sapper starter projects. Do you have any thoughts on this?
Apr 28, 2020, 9:15 PM
It should work in any framework, since it‘s mostly about how you query the data. You use Sappers route params in groq to find the correct route document, then you join the referenced page, so, something along the lines of this: