change templ
This commit is contained in:
@@ -2,7 +2,7 @@ package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"vctp/components/home"
|
||||
"vctp/components/views"
|
||||
)
|
||||
|
||||
// Home handles the home page.
|
||||
@@ -10,9 +10,21 @@ func (h *Handler) Home(w http.ResponseWriter, r *http.Request) {
|
||||
//h.html(r.Context(), w, http.StatusOK, core.HTML("Example Site", home.Home()))
|
||||
|
||||
// Render the template
|
||||
err := home.Home(h.BuildTime, h.SHA1Ver, h.GoVersion).Render(r.Context(), w)
|
||||
/*
|
||||
err := home.Home(h.BuildTime, h.SHA1Ver, h.GoVersion).Render(r.Context(), w)
|
||||
if err != nil {
|
||||
http.Error(w, "Failed to render template", http.StatusInternalServerError)
|
||||
}
|
||||
*/
|
||||
|
||||
info := views.BuildInfo{
|
||||
BuildTime: h.BuildTime,
|
||||
SHA1Ver: h.SHA1Ver,
|
||||
GoVersion: h.GoVersion,
|
||||
}
|
||||
|
||||
err := views.Index(info).Render(r.Context(), w)
|
||||
if err != nil {
|
||||
http.Error(w, "Failed to render template", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user