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

@@ -6,6 +6,7 @@ All notable changes to Gogs are documented in this file.
### Added
- Show file name in browser tab title when viewing files. [#5896](https://github.com/gogs/gogs/pull/5896)
- Support using TLS for Redis session provider using `[session] PROVIDER_CONFIG = ...,tls=true`. [#7860](https://github.com/gogs/gogs/pull/7860)
- Support expanading values in `app.ini` from environment variables, e.g. `[database] PASSWORD = ${DATABASE_PASSWORD}`. [#8057](https://github.com/gogs/gogs/pull/8057)
- Support custom logout URL that users get redirected to after sign out using `[auth] CUSTOM_LOGOUT_URL`. [#8089](https://github.com/gogs/gogs/pull/8089)

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