Skip to content

Commit b43e44f

Browse files
committed
add file path to title
1 parent d293a2b commit b43e44f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routers/repo/view.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
152152
}
153153
defer dataRc.Close()
154154

155+
ctx.Data["Title"] = ctx.Data["Title"].(string) + " - " + ctx.Repo.TreePath
156+
155157
ctx.Data["FileSize"] = blob.Size()
156158
ctx.Data["FileName"] = blob.Name()
157159
ctx.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())
@@ -311,6 +313,7 @@ func renderCode(ctx *context.Context) {
311313
if len(ctx.Repo.Repository.Description) > 0 {
312314
title += ": " + ctx.Repo.Repository.Description
313315
}
316+
314317
ctx.Data["Title"] = title
315318
ctx.Data["RequireHighlightJS"] = true
316319

0 commit comments

Comments
 (0)