From 8ee9922fe68531a47ce6ba8eefaf146a0a78549c Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Mon, 10 Sep 2018 18:01:49 +0100 Subject: [PATCH] Add file name and branch to page title (#4902) --- routers/repo/view.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routers/repo/view.go b/routers/repo/view.go index 4f1deeae40c..ff5c1afb495 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())