Documentation menu
Getting Started
Core Concepts
Control
Interactivity
Pushing Data
HTMX Extensions
Miscellaneous
Configuration
Introduction
htmgo lets you build interactive websites with Go and htmx. Use Go functions to render HTML components, then add htmx attributes to send requests and update parts of the page.
This page uses the standard library’s time package and github.com/franchb/htmgo/framework/v2/h.
func IndexPage(ctx *h.RequestContext) *h.Page {
now := time.Now()
return h.NewPage(
h.Div(
h.Class("flex gap-2"),
h.TextF("the current time is %s", now.String()),
),
)
}
Copy
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}The site you are reading now was written with htmgo!