-
-
Notifications
You must be signed in to change notification settings - Fork 356
/
reference-page.go
44 lines (38 loc) · 1015 Bytes
/
reference-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
package main
import (
"github.com/maxence-charriere/go-app/v10/pkg/analytics"
"github.com/maxence-charriere/go-app/v10/pkg/app"
)
type referencePage struct {
app.Compo
}
func newReferencePage() *referencePage {
return &referencePage{}
}
func (p *referencePage) OnNav(ctx app.Context) {
p.initPage(ctx)
}
func (p *referencePage) initPage(ctx app.Context) {
ctx.Page().SetTitle("Reference for building PWA with Go and WASM")
ctx.Page().SetDescription("Go-app API reference for building Progressive Web Apps (PWA) with Go (Golang) and WebAssembly (WASM).")
analytics.Page("reference", nil)
}
func (p *referencePage) Render() app.UI {
return newPage().
Title("Reference").
Icon(golangSVG).
Index(
app.A().
Class("index-link").
Class(fragmentFocus("pkg-overview")).
Href("#pkg-overview").
Text("Overview"),
newReferenceContent().
Class("reference-index").
Index(true),
app.Div().Class("separator"),
).
Content(
newReferenceContent().Class("reference"),
)
}