internal/examples/app/html/about.go (view raw)
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 | package html
import (
"time"
. "alin.ovh/gomponents"
. "alin.ovh/gomponents/html"
)
func AboutPage() Node {
now := time.Now()
return page(
"About",
H1(Text("About")),
P(Textf("Built with gomponents and rendered at %v.", now.Format(time.TimeOnly))),
P(
If(now.Second()%2 == 0, Text("It's an even second!")),
If(now.Second()%2 != 0, Text("It's an odd second!")),
),
Img(
Class("max-w-sm"),
Src("https://www.gomponents.com/images/logo.png"),
Alt("gomponents logo"),
),
)
}
|