blob: 0b16bd8692a2b53ec7b1f212a64e1b9b4012e09f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package handlers
import (
"log/slog"
"net/http"
"git.mihna123.com/openstore/internal/config"
)
type Page struct {
Lang string
Instance config.Instance
Data any
}
func (h *Handler) home(w http.ResponseWriter, r *http.Request) {
page := Page{Lang: "en", Instance: h.cfg.Instance}
err := h.tmpl.ExecuteTemplate(w, "index.html", page)
if err != nil {
slog.Error("render template", "err", err.Error())
return
}
}
|