all repos — gomponents @ c094266ccbc2cb4ebac4e2f2f6f9aee5c5740db8

HTML components in pure Go

Fix example app to use maragu.dev/gomponents module path (#216)

Markus Wüstenberg
commit

c094266ccbc2cb4ebac4e2f2f6f9aee5c5740db8

parent

fe24f0575214093cc72201ecc1cc463865dcb1e2

1 file changed, 4 insertions(+), 4 deletions(-)

changed files
M internal/examples/app/http/pages.gointernal/examples/app/http/pages.go
@@ -3,14 +3,14 @@
import ( "net/http" - g "github.com/maragudk/gomponents" - ghttp "github.com/maragudk/gomponents/http" + . "maragu.dev/gomponents" + ghttp "maragu.dev/gomponents/http" "app/html" ) func Home(mux *http.ServeMux) { - mux.Handle("GET /", ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (g.Node, error) { + mux.Handle("GET /", ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (Node, error) { // Let's pretend this comes from a db or something. items := []string{"Super", "Duper", "Nice"} return html.HomePage(items), nil
@@ -18,7 +18,7 @@ }))
} func About(mux *http.ServeMux) { - mux.Handle("GET /about", ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (g.Node, error) { + mux.Handle("GET /about", ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (Node, error) { return html.AboutPage(), nil })) }