all repos — gomponents @ 16f98a2bdbcfa112fb73fe318e88d497318ff8b3

HTML components in pure Go

move package to new domain

Alan Pearce
commit

16f98a2bdbcfa112fb73fe318e88d497318ff8b3

parent

4904eaacb6cd50fb18d0db4cb6e1a568b104ab86

M .golangci.yml.golangci.yml
@@ -4,4 +4,4 @@ linters:
settings: staticcheck: dot-import-whitelist: - - "go.alanpearce.eu/gomponents/html" + - "alin.ovh/gomponents/html"
M README.mdREADME.md
@@ -2,10 +2,10 @@ # Tired of complex template languages?
<img src="logo.png" alt="Logo" width="300" align="right"> -[![GoDoc](https://pkg.go.dev/badge/go.alanpearce.eu/gomponents)](https://pkg.go.dev/go.alanpearce.eu/gomponents) +[![GoDoc](https://pkg.go.dev/badge/alin.ovh/gomponents)](https://pkg.go.dev/alin.ovh/gomponents) [![Go](https://github.com/alanpearce/gomponents/actions/workflows/ci.yml/badge.svg)](https://github.com/alanpearce/gomponents/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/alanpearce/gomponents/branch/main/graph/badge.svg)](https://codecov.io/gh/alanpearce/gomponents) -[![Go Report Card](https://goreportcard.com/badge/go.alanpearce.eu/gomponents)](https://goreportcard.com/report/go.alanpearce.eu/gomponents) +[![Go Report Card](https://goreportcard.com/badge/alin.ovh/gomponents)](https://goreportcard.com/report/alin.ovh/gomponents) Try HTML components in pure Go.
@@ -14,7 +14,7 @@ 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. ```shell -go get go.alanpearce.eu/gomponents +go get alin.ovh/gomponents ``` Made with ✨sparkles✨ by [maragu](https://www.maragu.dev/), forked by [alanpearce](https://alanpearce.eu) to add helpers.
@@ -46,16 +46,16 @@
## Usage ```shell -go get go.alanpearce.eu/gomponents +go get alin.ovh/gomponents ``` ```go package main import ( - . "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/components" - . "go.alanpearce.eu/gomponents/html" + . "alin.ovh/gomponents" + . "alin.ovh/gomponents/components" + . "alin.ovh/gomponents/html" ) func Navbar(authenticated bool, currentPath string) Node {
M components/components.gocomponents/components.go
@@ -1,13 +1,13 @@
// Package components provides high-level components and helpers that are composed of low-level elements and attributes. -package components +package components // import "alin.ovh/gomponents/components" import ( "io" "sort" "strings" - g "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/html" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" ) // HTML5Props for [HTML5].
M components/components_test.gocomponents/components_test.go
@@ -4,10 +4,10 @@ import (
"os" "testing" - g "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/components" - . "go.alanpearce.eu/gomponents/html" - "go.alanpearce.eu/gomponents/internal/assert" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/components" + . "alin.ovh/gomponents/html" + "alin.ovh/gomponents/internal/assert" ) func TestHTML5(t *testing.T) {
M go.modgo.mod
@@ -1,3 +1,3 @@
-module go.alanpearce.eu/gomponents +module alin.ovh/gomponents go 1.23
M gomponents.gogomponents.go
@@ -16,7 +16,7 @@ //
// For higher-level HTML components, see the package components. // // For HTTP helpers, see the package http. -package gomponents +package gomponents // import "alin.ovh/gomponents" import ( "fmt"
M gomponents_test.gogomponents_test.go
@@ -10,8 +10,8 @@ "slices"
"strings" "testing" - g "go.alanpearce.eu/gomponents" - "go.alanpearce.eu/gomponents/internal/assert" + g "alin.ovh/gomponents" + "alin.ovh/gomponents/internal/assert" ) func TestNodeFunc(t *testing.T) {
M html/attributes.gohtml/attributes.go
@@ -1,7 +1,7 @@
-package html +package html // import "alin.ovh/gomponents/html" import ( - g "go.alanpearce.eu/gomponents" + g "alin.ovh/gomponents" ) func Async() g.Node {
M html/attributes_test.gohtml/attributes_test.go
@@ -4,9 +4,9 @@ import (
"fmt" "testing" - g "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/html" - "go.alanpearce.eu/gomponents/internal/assert" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" + "alin.ovh/gomponents/internal/assert" ) func TestBooleanAttributes(t *testing.T) {
M html/elements.gohtml/elements.go
@@ -3,12 +3,12 @@ //
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Element for a list of elements. // // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes for a list of attributes. -package html +package html // import "alin.ovh/gomponents/html" import ( "io" - g "go.alanpearce.eu/gomponents" + g "alin.ovh/gomponents" ) // Doctype returns a special kind of [g.Node] that prefixes its sibling with the string "<!doctype html>".
M html/elements_test.gohtml/elements_test.go
@@ -6,9 +6,9 @@ "fmt"
"strings" "testing" - g "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/html" - "go.alanpearce.eu/gomponents/internal/assert" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" + "alin.ovh/gomponents/internal/assert" ) type erroringWriter struct{}
M http/handler.gohttp/handler.go
@@ -1,10 +1,10 @@
// Package http provides adapters to render gomponents in http handlers. -package http +package http // import "alin.ovh/gomponents/http" import ( "net/http" - g "go.alanpearce.eu/gomponents" + g "alin.ovh/gomponents" ) // Handler is like [http.Handler] but returns a [g.Node] and an error.
M http/handler_test.gohttp/handler_test.go
@@ -7,8 +7,8 @@ "net/http"
"net/http/httptest" "testing" - g "go.alanpearce.eu/gomponents" - ghttp "go.alanpearce.eu/gomponents/http" + g "alin.ovh/gomponents" + ghttp "alin.ovh/gomponents/http" ) func TestAdapt(t *testing.T) {
M internal/assert/assert.gointernal/assert/assert.go
@@ -5,7 +5,7 @@ import (
"strings" "testing" - g "go.alanpearce.eu/gomponents" + g "alin.ovh/gomponents" ) // Equal checks for equality between the given expected string and the rendered Node string.
M internal/examples/app/go.modinternal/examples/app/go.mod
@@ -2,4 +2,4 @@ module app
go 1.23.2 -require go.alanpearce.eu/gomponents v1.0.0-beta1 +require alin.ovh/gomponents v1.0.0-beta1
M internal/examples/app/go.suminternal/examples/app/go.sum
@@ -1,2 +1,2 @@
-go.alanpearce.eu/gomponents v1.0.0-beta1 h1:I51NqKfrtQC4GxuWShqW5CT5BrfToMEueLD76IhdSXs= -go.alanpearce.eu/gomponents v1.0.0-beta1/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM= +alin.ovh/gomponents v1.0.0-beta1 h1:I51NqKfrtQC4GxuWShqW5CT5BrfToMEueLD76IhdSXs= +alin.ovh/gomponents v1.0.0-beta1/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM=
M internal/examples/app/go.work.suminternal/examples/app/go.work.sum
@@ -1,1 +1,1 @@
-go.alanpearce.eu/gomponents v1.0.0-beta1/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM= +alin.ovh/gomponents v1.0.0-beta1/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM=
M internal/examples/app/html/about.gointernal/examples/app/html/about.go
@@ -3,8 +3,8 @@
import ( "time" - . "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/html" + . "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" ) func AboutPage() Node {
M internal/examples/app/html/components.gointernal/examples/app/html/components.go
@@ -1,9 +1,9 @@
package html import ( - . "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/components" - . "go.alanpearce.eu/gomponents/html" + . "alin.ovh/gomponents" + . "alin.ovh/gomponents/components" + . "alin.ovh/gomponents/html" ) func page(title string, children ...Node) Node {
M internal/examples/app/html/home.gointernal/examples/app/html/home.go
@@ -1,8 +1,8 @@
package html import ( - . "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/html" + . "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" ) func HomePage(items []string) Node {
M internal/examples/app/http/pages.gointernal/examples/app/http/pages.go
@@ -3,8 +3,8 @@
import ( "net/http" - . "go.alanpearce.eu/gomponents" - ghttp "go.alanpearce.eu/gomponents/http" + . "alin.ovh/gomponents" + ghttp "alin.ovh/gomponents/http" "app/html" )
M internal/import/import_test.gointernal/import/import_test.go
@@ -3,10 +3,10 @@
import ( "testing" - . "go.alanpearce.eu/gomponents" - . "go.alanpearce.eu/gomponents/components" - . "go.alanpearce.eu/gomponents/html" - . "go.alanpearce.eu/gomponents/http" + . "alin.ovh/gomponents" + . "alin.ovh/gomponents/components" + . "alin.ovh/gomponents/html" + . "alin.ovh/gomponents/http" ) func TestImports(t *testing.T) {