Documentation menu

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.

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!