nuxt-modules / nuxt-modules/sanity
Extending prerender routes with Sanity
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 265
- Forks
- 43
- Avg merge
- 11h
- Merged PRs (30d)
- 18
Description
I'm trying to extend prerender routes fallowing this example
export default defineNuxtConfig({
hooks: {
async 'nitro:config' (nitroConfig) {
if (nitroConfig.dev) { return }
// ..Async logic..
nitroConfig.prerender.routes.push('/custom')
}
}
})
At this point I believe Sanity Client is not initialized.
I'm straggling to call Sanity and pass the array of dynamic routes who are not prerender by Nitro.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the nitro:config hook shown in the issue and trace when the Sanity Client becomes available relative to Nitro prerender setup. Compare the linked Nuxt example and verify a supported way to add Sanity-backed dynamic routes to nitroConfig.prerender.routes; done means those routes are collected and prerendered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxtjs, typescript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100