Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move module to maragu.dev/gomponents namespace #215

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

<img src="logo.png" alt="Logo" width="300" align="right"/>

[![GoDoc](https://pkg.go.dev/badge/github.com/maragudk/gomponents)](https://pkg.go.dev/github.com/maragudk/gomponents)
[![GoDoc](https://pkg.go.dev/badge/maragu.dev/gomponents)](https://pkg.go.dev/maragu.dev/gomponents)
[![Go](https://github.com/maragudk/gomponents/actions/workflows/ci.yml/badge.svg)](https://github.com/maragudk/gomponents/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/maragudk/gomponents/branch/main/graph/badge.svg)](https://codecov.io/gh/maragudk/gomponents)
[![Go Report Card](https://goreportcard.com/badge/github.com/maragudk/gomponents)](https://goreportcard.com/report/github.com/maragudk/gomponents)
[![Go Report Card](https://goreportcard.com/badge/maragu.dev/gomponents)](https://goreportcard.com/report/maragu.dev/gomponents)

Try HTML components in pure Go.

_gomponents_ are HTML components written in pure Go.
They render to HTML 5, and make it easy for you to build reusable components.
So you can focus on building your app instead of learning yet another templating language.

The API may change until version 1 is reached.
```shell
go get maragu.dev/gomponents
```

Made with ✨sparkles✨ by [maragu](https://www.maragu.dev/).

Expand All @@ -40,7 +42,7 @@ Check out [www.gomponents.com](https://www.gomponents.com) for an introduction.
## Usage

```shell
go get github.com/maragudk/gomponents
go get maragu.dev/gomponents
```

The preferred way to use gomponents is with so-called dot-imports (note the dot before the imports),
Expand All @@ -50,9 +52,9 @@ to give you that smooth, native HTML feel:
package main

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 Navbar(authenticated bool, currentPath string) Node {
Expand Down
4 changes: 2 additions & 2 deletions components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sort"
"strings"

g "github.com/maragudk/gomponents"
. "github.com/maragudk/gomponents/html"
g "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
)

// HTML5Props for [HTML5].
Expand Down
8 changes: 4 additions & 4 deletions components/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"os"
"testing"

g "github.com/maragudk/gomponents"
. "github.com/maragudk/gomponents/components"
. "github.com/maragudk/gomponents/html"
"github.com/maragudk/gomponents/internal/assert"
g "maragu.dev/gomponents"
. "maragu.dev/gomponents/components"
. "maragu.dev/gomponents/html"
"maragu.dev/gomponents/internal/assert"
)

func TestHTML5(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module "github.com/maragudk/gomponents"
module "maragu.dev/gomponents"

go 1.18
4 changes: 2 additions & 2 deletions gomponents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"
"testing"

g "github.com/maragudk/gomponents"
"github.com/maragudk/gomponents/internal/assert"
g "maragu.dev/gomponents"
"maragu.dev/gomponents/internal/assert"
)

func TestNodeFunc(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion html/attributes.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package html

import (
g "github.com/maragudk/gomponents"
g "maragu.dev/gomponents"
)

func Async() g.Node {
Expand Down
6 changes: 3 additions & 3 deletions html/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

g "github.com/maragudk/gomponents"
. "github.com/maragudk/gomponents/html"
"github.com/maragudk/gomponents/internal/assert"
g "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
"maragu.dev/gomponents/internal/assert"
)

func TestBooleanAttributes(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion html/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package html
import (
"io"

g "github.com/maragudk/gomponents"
g "maragu.dev/gomponents"
)

// Doctype returns a special kind of [g.Node] that prefixes its sibling with the string "<!doctype html>".
Expand Down
6 changes: 3 additions & 3 deletions html/elements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"testing"

g "github.com/maragudk/gomponents"
. "github.com/maragudk/gomponents/html"
"github.com/maragudk/gomponents/internal/assert"
g "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
"maragu.dev/gomponents/internal/assert"
)

type erroringWriter struct{}
Expand Down
2 changes: 1 addition & 1 deletion http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package http
import (
"net/http"

g "github.com/maragudk/gomponents"
g "maragu.dev/gomponents"
)

// Handler is like [http.Handler] but returns a [g.Node] and an error.
Expand Down
4 changes: 2 additions & 2 deletions http/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http/httptest"
"testing"

g "github.com/maragudk/gomponents"
ghttp "github.com/maragudk/gomponents/http"
g "maragu.dev/gomponents"
ghttp "maragu.dev/gomponents/http"
)

func TestAdapt(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

g "github.com/maragudk/gomponents"
g "maragu.dev/gomponents"
)

// Equal checks for equality between the given expected string and the rendered Node string.
Expand Down
Loading