about summary refs log tree commit diff stats
path: root/internal/examples/app/html/home.go
blob: fdd48dcee878d87963684c861f9f3a5479c9e9e4 (plain)
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
package html

import (
	. "go.alanpearce.eu/gomponents"
	. "go.alanpearce.eu/gomponents/html"
)

func HomePage(items []string) Node {
	return page(
		"Home",
		H1(Text("Home")),

		P(Text("This is a gomponents example app!")),

		P(
			Raw(
				`Have a look at the <a href="https:/github.com/alanpearce/gomponents/tree/main/internal/examples/app">source code</a> to see how it’s structured.`,
			),
		),

		Ul(Map(items, func(s string) Node {
			return Li(Text(s))
		})),
	)
}