-
-
Notifications
You must be signed in to change notification settings - Fork 355
/
routing-page.go
45 lines (37 loc) · 1.05 KB
/
routing-page.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"github.com/maxence-charriere/go-app/v10/pkg/analytics"
"github.com/maxence-charriere/go-app/v10/pkg/app"
)
type routingPage struct {
app.Compo
}
func newRoutingPage() *routingPage {
return &routingPage{}
}
func (p *routingPage) OnNav(ctx app.Context) {
p.initPage(ctx)
}
func (p *routingPage) initPage(ctx app.Context) {
ctx.Page().SetTitle("Routing URL paths to Components")
ctx.Page().SetDescription("Documentation about how to associate URL paths to go-app components.")
analytics.Page("routing", nil)
}
func (p *routingPage) Render() app.UI {
return newPage().
Title("Routing").
Icon(routeSVG).
Index(
newIndexLink().Title("Intro"),
newIndexLink().Title("Define a route"),
newIndexLink().Title(" Simple route"),
newIndexLink().Title(" Route with regular expression"),
newIndexLink().Title("How it works?"),
newIndexLink().Title("Detect navigation"),
app.Div().Class("separator"),
newIndexLink().Title("Next"),
).
Content(
newRemoteMarkdownDoc().Src("/web/documents/routing.md"),
)
}