Skip to content
Discussion options

You must be logged in to vote

I think what you want to use is https://nextjs.org/docs/app/building-your-application/routing/route-groups, but I couldn't really understand what you asked for. You'd want to group manage and public under a route group say app/(with-template), and create app/(with-template)/layout.tsx, and move manage and public directories there.

This would make these two routes consume their group root layout, and not the app/layout.tsx

For example, https://stackblitz.com/edit/nextjs-qq5bfcus?file=app%2Flayout.tsx,app%2F(foo)%2Flayout.tsx,app%2Fpage.tsx -- Though I noticed that having a app/(foo)/public/page.tsx causes 404's 🤔

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@bbhxwl
Comment options

@bbhxwl
Comment options

@bbhxwl
Comment options

@icyJoseph
Comment options

@bbhxwl
Comment options

Answer selected by bbhxwl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants