diff options
Diffstat (limited to 'routes/routes.go')
-rw-r--r-- | routes/routes.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/routes/routes.go b/routes/routes.go index 6c6df6c..f27a554 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -226,6 +226,11 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["ref"] = mainBranch data["readme"] = readmeContent data["commits"] = commits @@ -276,6 +281,11 @@ func (d *deps) RepoTree(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["ref"] = ref data["parent"] = treePath data["desc"] = getDescription(path) @@ -313,6 +323,11 @@ func (d *deps) FileContent(w http.ResponseWriter, r *http.Request) { contents, err := gr.FileContent(treePath) data := make(map[string]any) data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["ref"] = ref data["desc"] = getDescription(path) data["path"] = treePath @@ -358,6 +373,11 @@ func (d *deps) Log(w http.ResponseWriter, r *http.Request) { data["commits"] = commits data["meta"] = d.c.Meta data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["ref"] = ref data["desc"] = getDescription(path) data["log"] = true @@ -408,6 +428,11 @@ func (d *deps) Diff(w http.ResponseWriter, r *http.Request) { data["diff"] = diff.Diff data["meta"] = d.c.Meta data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["ref"] = ref data["desc"] = getDescription(path) @@ -459,6 +484,11 @@ func (d *deps) Refs(w http.ResponseWriter, r *http.Request) { data["meta"] = d.c.Meta data["name"] = name + if category != "" { + data["repo"] = filepath.Join(category, name) + } else { + data["repo"] = name + } data["branches"] = branches data["tags"] = tags data["desc"] = getDescription(path) |