diff options
author | Lunny Xiao | 2022-06-17 13:48:10 +0800 |
---|---|---|
committer | GitHub | 2022-06-17 06:48:10 +0100 |
commit | bdde56c95c338822f84857f9a0a20a73eb62ce6d (patch) | |
tree | 30a6a10ca59312355f4bd5e874bc24b2655e3441 | |
parent | 1e05adfc3eeeeee04be48c683185886fa4b00dee (diff) |
Fix Readme render bug (#19992)
Fix #19988
Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r-- | routers/web/repo/view.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index fe60cf44c..c327f959f 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, |