#2103 #2181 improvments of highlight class name

This commit is contained in:
Unknwon 2015-12-16 22:13:12 -05:00
parent 71142929cc
commit 6673dcb038
9 changed files with 95 additions and 14 deletions

View file

@ -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)