aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 23:59:17 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 23:59:17 +0800
commit0c0062b22ff4ddac9cf8c4ef84116eddba99bce2 (patch)
tree2d1790cdf42b0dcdb3f82f77cea2b86fb7a42120 /http_handle_repo_index.go
parentscfg: Remove tests for now (diff)
downloadforge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.tar.gz
forge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.tar.zst
forge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.zip
templates shall no longer be a global variable
Diffstat (limited to 'http_handle_repo_index.go')
-rw-r--r--http_handle_repo_index.go6
1 files changed, 3 insertions, 3 deletions
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
}