From 74ae6f42135c71bce8770bb9115a45e996c3a9e5 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 24 May 2022 19:41:04 +0400 Subject: [PATCH] Now index template is a variable. --- internal/handlers/handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 71f1882..0819ed9 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -66,7 +66,7 @@ func (h *RadioHandlers) Index(w http.ResponseWriter, r *http.Request) { } } - if err := web.Template("index").Execute(w, &IndexData{ + if err := web.IndexTemplate.Execute(w, &IndexData{ MainSite: utils.MainSite(r.Host), Status: status, Songs: songs, @@ -117,6 +117,6 @@ func (h *RadioHandlers) LastSong(w http.ResponseWriter, r *http.Request) { func (h *RadioHandlers) Playlist(w http.ResponseWriter, _ *http.Request) { w.Header().Add("Content-Disposition", "attachment; filename=\"radio.arav.top.m3u\"") - fc, _ := web.AssetsGetFile("web/assets/radio.arav.top.m3u") + fc, _ := web.AssetsGetFile("radio.arav.top.m3u") w.Write(fc) }