From f70f29fdb07d60e18f44bd49a213022bc04e1402 Mon Sep 17 00:00:00 2001 From: Georg Wicke-Arndt Date: Sat, 31 Jan 2026 04:11:10 +0100 Subject: [PATCH] Show file name in browser tab title when viewing files (#5896) --- CHANGELOG.md | 1 + internal/route/repo/view.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 073d7199d..a88aa482a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/internal/route/repo/view.go b/internal/route/repo/view.go index e83ae8931..6d554e282 100644 --- a/internal/route/repo/view.go +++ b/internal/route/repo/view.go @@ -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())