introduction:
htmgo is a lightweight pure go way to build interactive websites / web applications using go & htmx.
By combining the speed & simplicity of go + hypermedia attributes (htmx) to add interactivity to websites, all conveniently wrapped in pure go, you can build simple, fast, interactive websites without touching javascript. All compiled to a single deployable binary.
1func IndexPage(ctx *h.RequestContext) *h.Page {
2 now := time.Now()
3 return h.NewPage(
4 h.Div(
5 h.Class("flex gap-2"),
6 h.TextF("the current time is %s", now.String())
7 )
8 )
9}
core features:
what can be built with htmgo?
Most web applications can be built with htmgo, including but not limited to:
For a more detailed overview of when you should use hypermedia to build web applications, see when-to-use-hypermedia from htmx.org.
Interested in some examples? Check out examples.