From 0c0062b22ff4ddac9cf8c4ef84116eddba99bce2 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 23:59:17 +0800 Subject: templates shall no longer be a global variable --- http_handle_repo_index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'http_handle_repo_index.go') diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index bb5d57e..b564286 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -20,14 +20,14 @@ func (s *Server) httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, p client, err := git2c.NewClient(s.config.Git.Socket) if err != nil { - web.ErrorPage500(templates, w, params, err.Error()) + web.ErrorPage500(s.templates, w, params, err.Error()) return } defer client.Close() commits, readme, err := client.Cmd1(repoPath) if err != nil { - web.ErrorPage500(templates, w, params, err.Error()) + web.ErrorPage500(s.templates, w, params, err.Error()) return } @@ -35,7 +35,7 @@ func (s *Server) httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, p params["readme_filename"] = readme.Filename _, params["readme"] = render.Readme(readme.Content, readme.Filename) - renderTemplate(w, "repo_index", params) + s.renderTemplate(w, "repo_index", params) // TODO: Caching } -- cgit v1.2.3