summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2018-09-10 18:01:49 +0100
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-09-10 13:01:49 -0400
commit8ee9922fe68531a47ce6ba8eefaf146a0a78549c (patch)
tree604f6251dc4902ad3dda35739346bc6cd2ea59b8
parente47df0b301510a49b49fc43266f436b7d58a02b1 (diff)
downloadgitea-8ee9922fe68531a47ce6ba8eefaf146a0a78549c.tar.gz
gitea-8ee9922fe68531a47ce6ba8eefaf146a0a78549c.zip
Add file name and branch to page title (#4902)
-rw-r--r--routers/repo/view.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 4f1deeae40..ff5c1afb49 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -152,6 +152,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
}
defer dataRc.Close()
+ ctx.Data["Title"] = ctx.Data["Title"].(string) + " - " + ctx.Repo.TreePath + " at " + ctx.Repo.BranchName
+
ctx.Data["FileSize"] = blob.Size()
ctx.Data["FileName"] = blob.Name()
ctx.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())