How to set the homepage of Sanity when using Next.js catch all route.
Last updated: Feb 28, 2022
How do I set the homepage of sanity when using Next js catch all route? I have followed this tutorial from Simeon which works great. For prefixes and different types. But How do I specify a unique ID name to the page -> home from Sanity studio? From this example he has a ID but I am getting a unique generated ID
A document with a custom ID would be created either through the API/CLI (e.g.,
sanity documents create --id 'homePage'
) or by appending
in your Studio URL (e.g.,
Feb 28, 2022, 4:59 PM
Nice one Geoff! So, it doesn't matter if I change the slug for that page ID is staying unique?
Feb 28, 2022, 5:00 PM
Appending desired ID it's page “home” or by Title Home. So What would be the right command?
Feb 28, 2022, 5:02 PM
So, it doesn’t matter if I change the slug for that page ID is staying unique?
will never change.
Appending desired ID it’s page “home” or by Title Home. So What would be the right command?
I’m not understanding what you’re asking here. Both of the above approaches will only work to create a new document. If you want to change the existing one, you’ll need to script copying over the data or export to get the NDJSON and then import the new document.
Feb 28, 2022, 5:16 PM
I have removed my dummy page “Home” from my “Page” / Pages type. Now, I want to create that same page. This new page should have a ID homePage instead of the unique ID.
Feb 28, 2022, 5:20 PM
Ah, thank you. You’ll navigate to the page in your studio using the URL format