diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 9c7e12c..06fe912 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -45,7 +45,19 @@ func Initialise(a *config.AppConfig) { // HomeHandler handles /, generating data from Handlers func HomeHandler(w http.ResponseWriter, r *http.Request) { app.Logger.Info("Got request for homepage") - d := td.MakeBasicTemplateData(time.Now()) + + page := "home.page.tmpl" + d := models.TemplateData{} + + t, err := render.GetTemplateFromCache(page) + if err != nil { + app.Logger.Error(fmt.Sprintf("couldn't get %s from cache", page), "err", err) + } else { + d.StringMap = map[string]string{ + "GeneratedAt": t.GeneratedAt.Format(time.UnixDate), + } + } + var pages []models.Link = []models.Link{} for _, handler := range Handlers {