package htmx import ( "fmt" "net/http" ) func HxNotice(w http.ResponseWriter, id, msg string) { html := fmt.Sprintf(`%s`, id, msg) w.Header().Set("Content-Type", "text/html") w.WriteHeader(http.StatusOK) w.Write([]byte(html)) } func HxError(w http.ResponseWriter, status int, msg string) { w.WriteHeader(status) w.Write([]byte(msg)) } func HxRedirect(w http.ResponseWriter, status int, location string) { w.Header().Set("HX-Redirect", location) w.WriteHeader(status) }