Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Resolved conflicts by taking GitHub versions for: - .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml Kept deploy.sh updated to: - Pull from GitHub (primary source) - Push to Gitea (push-mirror) - Build from site/ directory (GitHub structure) Co-Authored-By: Paperclip <noreply@paperclip.ing>
1.6 KiB
1.6 KiB
| title | description |
|---|---|
| Route Groups | Route Groups can be used to partition your Next.js application into different sections. |
Route Groups are a folder convention that let you organize routes by category or team.
Convention
A route group can be created by wrapping a folder's name in parenthesis: (folderName).
This convention indicates the folder is for organizational purposes and should not be included in the route's URL path.
Use cases
- Organizing routes by team, concern, or feature.
- Defining multiple root layouts.
- Opting specific route segments into sharing a layout, while keeping others out.
Caveats
- Full page load: If you navigate between routes that use different root layouts, it'll trigger a full page reload. For example, navigating from
/cartthat usesapp/(shop)/layout.jsto/blogthat usesapp/(marketing)/layout.js. This only applies to multiple root layouts. - Conflicting paths: Routes in different groups should not resolve to the same URL path. For example,
(marketing)/about/page.jsand(shop)/about/page.jswould both resolve to/aboutand cause an error. - Top-level root layout: If you use multiple root layouts without a top-level
layout.jsfile, make sure your home route (/) is defined within one of the route groups, e.g. app/(marketing)/page.js.