diff --git a/README.md b/README.md index cbe7ea676a2a0aabe39528052cd5065fdbc438cf..e0a7fd46fc36021ebab17321536af6eae23e6826 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Features - **Repository Management**: Supports multiple repositories grouped by category in `config.yaml`. -- **Browsing**: Navigate commit history, directory trees, and file contents. +- **Browsing**: Navigate commit history, directory files, and file contents. - **Syntax Highlighting**: Automatic language detection and highlighting via [Chroma](https://github.com/alecthomas/chroma). - **Markdown Rendering**: Renders README files with GFM support and GitHub-style alerts via [Goldmark](https://github.com/yuin/goldmark). - **Language Statistics**: Visual breakdown of programming languages used in each repository. @@ -81,7 +81,7 @@ | Endpoint | Description | |----------|-------------| | `/` | Home page with grouped repository list. | | `/r/{name}` | Commit history (log) for the repository. | -| `/r/{name}/tree/{path}` | Directory tree browser. | +| `/r/{name}/files/{path}` | Directory file browser. | | `/r/{name}/blob/{path}` | File viewer with syntax highlighting. | | `/r/{name}/raw/{path}` | Raw file download. | | `/r/{name}/markers` | Results of the `TODO:` and `FIXME:` scanner. | diff --git a/htree.go b/hfiles.go rename from htree.go rename to hfiles.go index da4eb5db55637cc7fd44744a2e8557fe14af9520..39823981edac16063e606316fd03f96037507728 100644 --- a/htree.go +++ b/hfiles.go @@ -16,7 +16,7 @@ "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" ) -func treeHandler(w http.ResponseWriter, r *http.Request) { +func filesHandler(w http.ResponseWriter, r *http.Request) { ctx, err := getRepoContext(w, r) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) @@ -86,10 +86,10 @@ }{ RepoContext: ctx, Entries: entries, Path: pathValue, - View: "tree", + View: "files", } - err = templates.ExecuteTemplate(w, "tree.html", data) + err = templates.ExecuteTemplate(w, "files.html", data) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } diff --git a/main.go b/main.go index 10251b9f3c51af0ff4e13e0b299a4a04f982a391..8748cb32225b7c05ed2e1f02ebe85f0b7133a71d 100644 --- a/main.go +++ b/main.go @@ -68,7 +68,7 @@ mux.HandleFunc("GET /r/{name}/license", licenseHandler) mux.HandleFunc("GET /r/{name}/markers", markersHandler) mux.HandleFunc("GET /r/{name}/commits.rss", repoCommitsRSSHandler) mux.HandleFunc("GET /r/{name}/tags.rss", repoTagsRSSHandler) - mux.HandleFunc("GET /r/{name}/tree/{path...}", treeHandler) + mux.HandleFunc("GET /r/{name}/files/{path...}", filesHandler) mux.HandleFunc("GET /r/{name}/blob/{path...}", blobHandler) mux.HandleFunc("GET /r/{name}/raw/{path...}", rawHandler) mux.HandleFunc("GET /r/{name}/archive/{path...}", archiveHandler) diff --git a/views/blob.html b/views/blob.html index 15d82b37d514e8b8e89880d6c7352bf5dad6f7b5..daee5f1c51dc88fd7debdaa7aff6cd597f150f96 100644 --- a/views/blob.html +++ b/views/blob.html @@ -13,7 +13,7 @@ {{template "nav-repository.html" .}}
diff --git a/views/nav-repository.html b/views/nav-repository.html index 5d76daae8df228227872f74c1ebe08b356dcc48b..5e98368f6d6f4e4bd32f1bb582a1f73fcd61f9e5 100644 --- a/views/nav-repository.html +++ b/views/nav-repository.html @@ -1,7 +1,7 @@