index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
routers
/
repo
/
view.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Unknwon <u@gogs.io>
2015-12-16 22:13:12 -0500
committer
Unknwon <u@gogs.io>
2015-12-16 22:13:12 -0500
commit
6673dcb0380aa99da25b4d1d68cf129635fe30d9
(
patch
)
tree
45167c2f2991818467389866847c402e3a48e906
/
routers/repo/view.go
parent
71142929cc35e9b7c73b659c38b5eb42dc42bb83
(
diff
)
#2103 #2181 improvments of highlight class name
Diffstat
(limited to 'routers/repo/view.go')
-rw-r--r--
routers/repo/view.go
6
1 files changed, 1 insertions, 5 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 4ba26a0c..191f1234 100644
--- a/
routers/repo/view.go
+++ b/
routers/repo/view.go
@@ -79,11 +79,7 @@ func Home(ctx *middleware.Context) {
ctx.Data["FileSize"] = blob.Size()
ctx.Data["IsFile"] = true
ctx.Data["FileName"] = blob.Name()
- ext := path.Ext(blob.Name())
- if len(ext) > 0 {
- ext = ext[1:]
- }
- ctx.Data["FileExt"] = ext
+ ctx.Data["HighlightClass"] = template.FileNameToHighlightClass(blob.Name())
ctx.Data["FileLink"] = rawLink + "/" + treename
buf := make([]byte, 1024)