From fb38f1326240ddcfbe2829233cdcee3dafe3c56a Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 5 Feb 2023 06:25:22 +0400 Subject: [PATCH] Added a mockup for RSS. Made use of GetServiceByHost() func. --- internal/http/handlers.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index cfff945..b166dfd 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -7,6 +7,7 @@ import ( "git.arav.top/Arav/dwelling-home/pkg/mindflow" "git.arav.top/Arav/dwelling-home/pkg/servicestat" + "git.arav.top/Arav/dwelling-home/pkg/util" "git.arav.top/Arav/dwelling-home/web" ) @@ -59,7 +60,7 @@ func (h *Handlers) About(w http.ResponseWriter, r *http.Request) { } } - web.About("/ About", "", lst, w) + web.About("/ About", util.GetServiceByHost(r.Host, util.ServiceFiles), lst, w) } func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) { @@ -74,7 +75,10 @@ func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) { } func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) { - web.RSS(r.Host, "Arav", nil, r, w) + posts := []mindflow.Post{ + {Category: "Kek", Date: time.Now(), Title: "LMAO", Body: "Testing!"}, + } + web.RSS(r.URL.Scheme+"://"+r.Host, "Arav", posts, r, w) } func (h *Handlers) Robots(w http.ResponseWriter, r *http.Request) {