Show file name in browser tab title when viewing files (#5896)

This commit is contained in:
Georg Wicke-Arndt
2026-01-31 04:11:10 +01:00
committed by GitHub
parent ed6109d35d
commit f70f29fdb0
2 changed files with 2 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
return
}
c.Data["Title"] = blob.Name() + " - " + c.Data["Title"].(string)
c.Data["FileSize"] = blob.Size()
c.Data["FileName"] = blob.Name()
c.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())