-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
52 lines (45 loc) · 830 Bytes
/
main.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
46
47
48
49
50
51
52
package main
import (
b "github.com/willoma/bulma-gomponents"
x "maragu.dev/gomponents-htmx"
. "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
)
func main() {
Get("/{$}", func(r Request) Response {
return Ok(
Layout(
Navbar(),
b.Section(Text("Hello World!")),
),
)
})
Get("/about", func(r Request) Response {
return Ok(
Layout(
Navbar(),
b.Section(Text("About")),
),
)
})
Start()
}
func Navbar() Node {
return b.Navbar(
b.Dark,
x.Boost("true"),
b.NavbarStart(
b.NavbarAHref("/", "Home"),
b.NavbarAHref("/about", "About"),
),
)
}
func Layout(view ...Node) Node {
return b.HTML(
Lang("en"),
b.HTitle("Hello World!"),
b.Stylesheet("/public/style.css?v="+Sha256("public/style.css")),
b.Script("https://unpkg.com/[email protected]"),
Group(view),
)
}