use go templates for the web pages

This commit is contained in:
lyx0 2023-12-20 02:08:14 +01:00
parent ae4237e0e8
commit 20b598ee3b

View file

@ -69,7 +69,6 @@ func (app *application) commandsRoute(w http.ResponseWriter, r *http.Request, _
} }
type homeRouteData struct { type homeRouteData struct {
Name string
Channels []*data.Channel Channels []*data.Channel
} }
@ -87,7 +86,7 @@ func (app *application) homeRoute(w http.ResponseWriter, r *http.Request, _ http
} }
app.Log.Infow("All channels:", app.Log.Infow("All channels:",
"channel", allChannel) "channel", allChannel)
data := &homeRouteData{name, allChannel} data := &homeRouteData{allChannel}
err = t.Execute(w, data) err = t.Execute(w, data)
if err != nil { if err != nil {