diff options
-rw-r--r-- | handle_repo_index.go | 1 | ||||
-rw-r--r-- | templates/repo_index.html | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/handle_repo_index.go b/handle_repo_index.go index ea8aeba..23dd334 100644 --- a/handle_repo_index.go +++ b/handle_repo_index.go @@ -27,6 +27,7 @@ func handle_repo_index(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Error getting repo HEAD: " + err.Error())) return } + data["ref"] = head.Name().Short() head_hash := head.Hash() commit_iter, err := repo.Log(&git.LogOptions{From: head_hash}) if err != nil { diff --git a/templates/repo_index.html b/templates/repo_index.html index 866a020..cf1326f 100644 --- a/templates/repo_index.html +++ b/templates/repo_index.html @@ -42,10 +42,11 @@ </tr> </thead> <tbody> +{{- $ref := .ref }} {{- range .files }} <tr> <td class="file-mode">{{ .Mode }}</td> -<td class="file-name">{{ .Name }}</td> +<td class="file-name"><a href="tree/{{ $ref }}/{{ .Name }}">{{ .Name }}</a></td> <td class="file-size">{{ .Size }}</td> </tr> {{- end }} |