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
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package skeleton
import (
_ "embed"
. "maragu.dev/gomponents"
. "maragu.dev/gomponents/components"
. "maragu.dev/gomponents/html"
)
//go:embed style.css
var styles string
func Page(title string, children ...Node) Node {
return HTML5(HTML5Props{
Title: title,
Language: "en",
Head: []Node{
StyleEl(Raw(styles)),
},
Body: []Node{
Div(Class("container"),
Group(children),
footer(),
),
},
})
}
func footer() Node {
return Footer(
Hr(),
Text("scrapbook"),
)
}
func NavButton(label string, dest string) Node {
return A(
Class("button"),
Href(dest),
Text(label),
)
}
func Alert(label string, class string) Node {
return Div(
Class("alert "+class),
Text(label),
)
}
func AlertError(label string) Node {
return Alert(label, "error")
}
func AlertSuccess(label string) Node {
return Alert(label, "success")
}
|