diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index a43840467..3e869376e 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -119,6 +119,7 @@ func renderDirectory(ctx *context.Context, treeLink string) { } if ctx.Repo.TreePath != "" { + ctx.Data["HideRepoInfo"] = true ctx.Data["Title"] = ctx.Tr("repo.file.title", ctx.Repo.Repository.Name+"/"+path.Base(ctx.Repo.TreePath), ctx.Repo.RefName) } @@ -360,6 +361,7 @@ func renderReadmeFile(ctx *context.Context, readmeFile *namedBlob, readmeTreelin func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink string) { ctx.Data["IsViewFile"] = true + ctx.Data["HideRepoInfo"] = true blob := entry.Blob() dataRc, err := blob.DataAsync() if err != nil { diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index e1aa1c4f3..9d4842579 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -3,6 +3,7 @@ {{template "repo/header" .}}