Skip to content
Discussion options

You must be logged in to vote

Yep, you can do it by hand. Groups aren't really a module-router thing, they're part of the path syntax: a segment in parentheses like (admin) counts for layout/layer matching but gets stripped from the URL. The module router just turns _admin into that under the hood (app::_marketing::pricing becomes /(_marketing)/pricing).

So with the plain router you'd write:

#[layout("/(admin)")]
async fn admin_layout(slot: Slot<'_>) -> Result<impl View> {
    // ...
}

#[page("/(admin)/users")]      // served at /users
async fn users() -> Result<impl View> { /* ... */ }

#[page("/(admin)/settings")]   // served at /settings
async fn settings() -> Result<impl View> { /* ... */ }

#[page("/about")]    …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@TheMysteriousGhost
Comment options

Answer selected by jonner
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants