aboutsummaryrefslogtreecommitdiff
path: root/handle_repo_index.go
diff options
context:
space:
mode:
Diffstat (limited to 'handle_repo_index.go')
-rw-r--r--handle_repo_index.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/handle_repo_index.go b/handle_repo_index.go
index c0bef4a..1c03ece 100644
--- a/handle_repo_index.go
+++ b/handle_repo_index.go
@@ -2,6 +2,7 @@ package main
import (
"net/http"
+ "net/url"
)
func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string]string) {
@@ -40,6 +41,8 @@ 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"])
+
err = templates.ExecuteTemplate(w, "repo_index", data)
if err != nil {
_, _ = w.Write([]byte("Error rendering template: " + err.Error()))