aboutsummaryrefslogtreecommitdiff
path: root/handle_repo_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-12 22:37:51 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-12 22:37:51 +0800
commit11a8f2889e874ecebdbc49a6887918c7b043c503 (patch)
tree0ead7076fe6df7a1edf6d3a54963ae328a2f0084 /handle_repo_index.go
parentREADME.md: Update about SSH implementation (diff)
downloadforge-11a8f2889e874ecebdbc49a6887918c7b043c503.tar.gz
forge-11a8f2889e874ecebdbc49a6887918c7b043c503.tar.zst
forge-11a8f2889e874ecebdbc49a6887918c7b043c503.zip
{ssh,global}.go, index.html: Add global data containing ssh fp
Diffstat (limited to 'handle_repo_index.go')
-rw-r--r--handle_repo_index.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/handle_repo_index.go b/handle_repo_index.go
index 1c03ece..0c7b570 100644
--- a/handle_repo_index.go
+++ b/handle_repo_index.go
@@ -7,6 +7,7 @@ import (
func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string]string) {
data := make(map[string]any)
+ data["global"] = global_data
group_name, repo_name := params["group_name"], params["repo_name"]
data["group_name"], data["repo_name"] = group_name, repo_name
repo, err := open_git_repo(r.Context(), group_name, repo_name)
@@ -41,7 +42,7 @@ func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string
data["readme_filename"], data["readme"] = render_readme_at_tree(tree)
data["files"] = build_display_git_tree(tree)
- data["clone_url"] = "ssh://" + r.Host + "/" + url.PathEscape(params["group_name"]) + "/:/repos/" + url.PathEscape(params["repo_name"])
+ data["clone_url"] = "ssh://" + r.Host + "/" + url.PathEscape(params["group_name"]) + "/:/repos/" + url.PathEscape(params["repo_name"])
err = templates.ExecuteTemplate(w, "repo_index", data)
if err != nil {