
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis question is about general Next.js routing architecture rather than Sanity-specific functionality. You'd get better answers in Next.js-focused communities like the Next.js GitHub Discussions, the Next.js Discord, or Stack Overflow with the next.js tag.
That said, if you're building a Sanity-powered site with Next.js and finding yourself duplicating logic across route files, there are some Sanity-specific patterns that might help reduce that duplication:
The routing architecture decision itself (catch-all vs. discrete files) is a Next.js concern that applies regardless of your CMS, so the Next.js community will have more targeted advice for your specific use case!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store