aboutsummaryrefslogtreecommitdiffgithub
diff options
context:
space:
mode:
authorAustin Adams <git@austinjadams.com>2017-06-24 21:10:06 -0400
committerAustin Adams <git@austinjadams.com>2017-06-24 21:13:57 -0400
commit3999a905d75172d83f26996586acf9ff778d5a56 (patch)
tree0779f737543203051a73827566c0cbeda379ccff
parent2ad7ce76efa8c6448a2a2f4e0366f2c3e9f8c9c8 (diff)
downloadgong-3999a905d75172d83f26996586acf9ff778d5a56.tar.gz
gong-3999a905d75172d83f26996586acf9ff778d5a56.tar.xz
templates/repo-tree: Add line number anchors
Add line number anchors to tree blob displays which imitate cgit's (for backwards URL compatibility).
-rw-r--r--templates/repo-tree.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/repo-tree.html b/templates/repo-tree.html
index f3dad79..02170eb 100644
--- a/templates/repo-tree.html
+++ b/templates/repo-tree.html
@@ -20,7 +20,8 @@
{{ end }}
{{ define "repo-body" }}
{{ if not .IsListing }}
- <pre><code>{{ .Blob }}</code></pre>
+ <pre><code>{{ range $lineNum, $line := (split .Blob "\n") }}<span class="line" id="n{{ add $lineNum 1 }}">{{ $line }}</span>
+{{ end }}</code></pre>
{{ end }}
{{ end }}