Skip to content

Commit

Permalink
hide unlisted subpages in subnav
Browse files Browse the repository at this point in the history
closes T-907
  • Loading branch information
danphilibin committed Apr 17, 2023
1 parent ee5991c commit 41c3366
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/examples/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,35 @@ const empty_page = new Page({
},
routes: {
child_action: new Action(async () => {
return 'Hello!'
await io.group([
io.display.link('Go to unlisted action', {
route: 'empty_page/unlisted_action',
theme: 'secondary',
}),
io.display.link('Go to unlisted page', {
route: 'empty_page/unlisted_page',
theme: 'secondary',
}),
])
}),
unlisted_action: new Action({
unlisted: true,
handler: async () => {
return 'Hello!'
},
}),
unlisted_page: new Page({
name: 'Unlisted page',
unlisted: true,
handler: async () => {
return new Layout({
children: [
io.display.markdown(
'This page is unlisted, but you can still access it!'
),
],
})
},
}),
show_layout: new Action(async () => {
ctx.redirect({ route: 'empty_page', params: { show_layout: 1 } })
Expand Down

0 comments on commit 41c3366

Please sign in to comment.