all repos — gopkgs @ f3acff6849abe451355e551c01b4b02759c48b48

Go module vanity import paths

replace templ with gomponents

Alan Pearce
commit

f3acff6849abe451355e551c01b4b02759c48b48

parent

881ed5e5e6bf157ccbe9046fd406fe49ae3ea64b

1 file changed, 5 insertions(+), 6 deletions(-)

changed files
M main.gomain.go
@@ -1,26 +1,25 @@
package main import ( - "context" "fmt" "log" "net/url" "os" "path/filepath" - "github.com/a-h/templ" "github.com/pelletier/go-toml/v2" + "go.alanpearce.eu/gomponents" ) type Config struct { Title string Domain string Forge string - Menu []*Link + Menu []*MenuLink Packages []string } -type Link struct { +type MenuLink struct { Name string URL string }
@@ -83,7 +82,7 @@ }
const destDir = "dist" -func renderToFile(c templ.Component, filename string) error { +func renderToFile(c gomponents.Node, filename string) error { pathname := filepath.Join(destDir, filename) err := os.MkdirAll(filepath.Dir(pathname), 0755) if err != nil {
@@ -95,7 +94,7 @@ return err
} defer file.Close() - return c.Render(context.Background(), file) + return c.Render(file) } func main() {