From 7ebd0db05ae033a86c8221bcc2bef206cf030f3d Mon Sep 17 00:00:00 2001 From: "Grail Finder (aider)" Date: Thu, 1 May 2025 18:16:56 +0300 Subject: [PATCH] feat: display color-coded word cards on index page --- components/index.html | 19 +++++++++++++++++-- handlers/handlers.go | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/components/index.html b/components/index.html index 0c4081d..14ef046 100644 --- a/components/index.html +++ b/components/index.html @@ -7,7 +7,22 @@ -

HTMX + Go Starter

-

Edit this HTML in templates/public/index.html

+

Word Color Cards

+
+ {{range $word, $color := .}} +
+ {{$word}} +
+ {{end}} +
diff --git a/handlers/handlers.go b/handlers/handlers.go index 3e78a10..cb0b704 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -19,5 +19,5 @@ func HandlePing(w http.ResponseWriter, r *http.Request) { func HandleHome(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles("../components/index.html")) - tmpl.Execute(w, nil) + tmpl.Execute(w, roundWords) }