From b3ceba5ca68d9198b712d350f0be1264f680d040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Wed, 24 Jan 2024 00:56:16 -0800 Subject: [PATCH] ensure homepage has generated time --- internal/handlers/handlers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 06fe912..047b6cb 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -52,6 +52,9 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) { t, err := render.GetTemplateFromCache(page) if err != nil { app.Logger.Error(fmt.Sprintf("couldn't get %s from cache", page), "err", err) + d.StringMap = map[string]string{ + "GeneratedAt": time.Now().Format(time.UnixDate), + } } else { d.StringMap = map[string]string{ "GeneratedAt": t.GeneratedAt.Format(time.UnixDate),