replace templ with gomponents
1 file changed, 5 insertions(+), 6 deletions(-)
changed files
M main.go → main.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() {