From c094266ccbc2cb4ebac4e2f2f6f9aee5c5740db8 Mon Sep 17 00:00:00 2001
From: Markus Wüstenberg
Date: Thu, 3 Oct 2024 11:32:52 +0200
Subject: Fix example app to use maragu.dev/gomponents module path (#216)
---
internal/examples/app/cmd/app/main.go | 2 +-
internal/examples/app/go.mod | 2 +-
internal/examples/app/go.sum | 4 ++--
internal/examples/app/html/about.go | 4 ++--
internal/examples/app/html/components.go | 6 +++---
internal/examples/app/html/home.go | 6 +++---
internal/examples/app/http/pages.go | 8 ++++----
7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/internal/examples/app/cmd/app/main.go b/internal/examples/app/cmd/app/main.go
index 0c01576..5dad32a 100644
--- a/internal/examples/app/cmd/app/main.go
+++ b/internal/examples/app/cmd/app/main.go
@@ -8,6 +8,6 @@ import (
func main() {
if err := http.Start(); err != nil {
- slog.Info("Error", 1, "error", err)
+ slog.Info("Error starting", "error", err)
}
}
diff --git a/internal/examples/app/go.mod b/internal/examples/app/go.mod
index a86bad6..a234275 100644
--- a/internal/examples/app/go.mod
+++ b/internal/examples/app/go.mod
@@ -2,4 +2,4 @@ module app
go 1.23.1
-require github.com/maragudk/gomponents v0.20.5
+require maragu.dev/gomponents v0.22.1-0.20241003092644-fe24f0575214
diff --git a/internal/examples/app/go.sum b/internal/examples/app/go.sum
index 37a89f1..6a8ac6d 100644
--- a/internal/examples/app/go.sum
+++ b/internal/examples/app/go.sum
@@ -1,2 +1,2 @@
-github.com/maragudk/gomponents v0.20.5 h1:Z8phdQIW+NqAGO0clMh/wyv1/M7viUBf7/EL44gvwtI=
-github.com/maragudk/gomponents v0.20.5/go.mod h1:nHkNnZL6ODgMBeJhrZjkMHVvNdoYsfmpKB2/hjdQ0Hg=
+maragu.dev/gomponents v0.22.1-0.20241003092644-fe24f0575214 h1:bNGcux5RpG5WWQby69VsE0GexUxryln8ltlfdaf06oI=
+maragu.dev/gomponents v0.22.1-0.20241003092644-fe24f0575214/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM=
diff --git a/internal/examples/app/html/about.go b/internal/examples/app/html/about.go
index 37b797f..61a5001 100644
--- a/internal/examples/app/html/about.go
+++ b/internal/examples/app/html/about.go
@@ -3,8 +3,8 @@ package html
import (
"time"
- . "github.com/maragudk/gomponents"
- . "github.com/maragudk/gomponents/html"
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/html"
)
func AboutPage() Node {
diff --git a/internal/examples/app/html/components.go b/internal/examples/app/html/components.go
index 25880a3..ad5d582 100644
--- a/internal/examples/app/html/components.go
+++ b/internal/examples/app/html/components.go
@@ -1,9 +1,9 @@
package html
import (
- . "github.com/maragudk/gomponents"
- . "github.com/maragudk/gomponents/components"
- . "github.com/maragudk/gomponents/html"
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/components"
+ . "maragu.dev/gomponents/html"
)
func page(title string, children ...Node) Node {
diff --git a/internal/examples/app/html/home.go b/internal/examples/app/html/home.go
index a3d729b..c06aa66 100644
--- a/internal/examples/app/html/home.go
+++ b/internal/examples/app/html/home.go
@@ -1,8 +1,8 @@
package html
import (
- . "github.com/maragudk/gomponents"
- . "github.com/maragudk/gomponents/html"
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/html"
)
func HomePage(items []string) Node {
@@ -11,7 +11,7 @@ func HomePage(items []string) Node {
P(Text("This is a gomponents example app!")),
- P(Raw(`Have a look at the source code to see how it’s structured.`)),
+ P(Raw(`Have a look at the source code to see how it’s structured.`)),
Ul(Map(items, func(s string) Node {
return Li(Text(s))
diff --git a/internal/examples/app/http/pages.go b/internal/examples/app/http/pages.go
index dd686c0..b09589b 100644
--- a/internal/examples/app/http/pages.go
+++ b/internal/examples/app/http/pages.go
@@ -3,14 +3,14 @@ package http
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 Home(mux *http.ServeMux) {
}
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
}))
}
--
cgit 1.4.1