diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-11 12:32:33 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-11 12:32:33 +0800 |
commit | 662aeed1122dae0cbb74022b3bfb4013075c36f8 (patch) | |
tree | 3b9afbcef743d101bd5935489c51dba443016e84 /handle_category_index.go | |
parent | git_misc: Don't return error on repos with fewer than 3 commits (diff) | |
download | forge-662aeed1122dae0cbb74022b3bfb4013075c36f8.tar.gz forge-662aeed1122dae0cbb74022b3bfb4013075c36f8.tar.zst forge-662aeed1122dae0cbb74022b3bfb4013075c36f8.zip |
group_{index,repos}: Rename files too
Diffstat (limited to 'handle_category_index.go')
-rw-r--r-- | handle_category_index.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/handle_category_index.go b/handle_category_index.go deleted file mode 100644 index f194cee..0000000 --- a/handle_category_index.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "net/http" - "os" - "path/filepath" - "strings" -) - -func handle_group_repos(w http.ResponseWriter, r *http.Request) { - data := make(map[string]any) - group_name := r.PathValue("group_name") - data["group_name"] = group_name - entries, err := os.ReadDir(filepath.Join(config.Git.Root, group_name)) - if err != nil { - _, _ = w.Write([]byte("Error listing repos: " + err.Error())) - return - } - - repos := []string{} - for _, entry := range entries { - this_name := entry.Name() - if strings.HasSuffix(this_name, ".git") { - repos = append(repos, strings.TrimSuffix(this_name, ".git")) - } - } - data["repos"] = repos - - err = templates.ExecuteTemplate(w, "group_repos", data) - if err != nil { - _, _ = w.Write([]byte("Error rendering template: " + err.Error())) - return - } -} |