Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

knotmirror: add index page

just one of those things i would like

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by
Tangled
(May 15, 2026, 9:28 PM +0300) 2009fa81 fdf462ad

+15
+11
knotmirror/adminpage.go
··· 43 43 44 44 func (s *AdminServer) Router() http.Handler { 45 45 r := chi.NewRouter() 46 + r.Get("/", s.handleIndex()) 46 47 r.Get("/repos", s.handleRepos()) 47 48 r.Get("/hosts", s.handleHosts()) 48 49 ··· 76 77 "AllHostStatuses": models.AllHostStatuses, 77 78 } 78 79 }, 80 + } 81 + } 82 + 83 + func (s *AdminServer) handleIndex() http.HandlerFunc { 84 + tpl := template.Must(template.New("").Funcs(funcmap()).ParseFS(templateFS, "templates/base.html", "templates/index.html")) 85 + return func(w http.ResponseWriter, r *http.Request) { 86 + err := tpl.ExecuteTemplate(w, "base", nil) 87 + if err != nil { 88 + slog.Error("failed to render", "err", err) 89 + } 79 90 } 80 91 } 81 92
+4
knotmirror/templates/index.html
··· 1 + {{template "base" .}} 2 + {{define "content"}} 3 + <h1>Knotmirror</h1> 4 + {{end}}