summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-06-17 13:48:10 +0800
committerGitHub <noreply@github.com>2022-06-17 06:48:10 +0100
commitbdde56c95c338822f84857f9a0a20a73eb62ce6d (patch)
tree30a6a10ca59312355f4bd5e874bc24b2655e3441 /routers
parent1e05adfc3eeeeee04be48c683185886fa4b00dee (diff)
downloadgitea-bdde56c95c338822f84857f9a0a20a73eb62ce6d.tar.gz
gitea-bdde56c95c338822f84857f9a0a20a73eb62ce6d.zip
Fix Readme render bug (#19992)
Fix #19988 Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/view.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index fe60cf44c7..c327f959f6 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -357,7 +357,7 @@ func renderReadmeFile(ctx *context.Context, readmeFile *namedBlob, readmeTreelin
var result strings.Builder
err := markup.Render(&markup.RenderContext{
Ctx: ctx,
- RelativePath: ctx.Repo.TreePath,
+ RelativePath: path.Join(ctx.Repo.TreePath, readmeFile.name), // ctx.Repo.TreePath is the directory not the Readme so we must append the Readme filename (and path).
URLPrefix: readmeTreelink,
Metas: ctx.Repo.Repository.ComposeDocumentMetas(),
GitRepo: ctx.Repo.GitRepo,