mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
use go templates for the web pages
This commit is contained in:
parent
ae4237e0e8
commit
20b598ee3b
1 changed files with 1 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue