Skip to content

Commit bdde56c

Browse files
lunnyzeripath
andauthored
Fix Readme render bug (#19992)
Fix #19988 Co-authored-by: zeripath <[email protected]>
1 parent 1e05adf commit bdde56c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/view.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func renderReadmeFile(ctx *context.Context, readmeFile *namedBlob, readmeTreelin
357357
var result strings.Builder
358358
err := markup.Render(&markup.RenderContext{
359359
Ctx: ctx,
360-
RelativePath: ctx.Repo.TreePath,
360+
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).
361361
URLPrefix: readmeTreelink,
362362
Metas: ctx.Repo.Repository.ComposeDocumentMetas(),
363363
GitRepo: ctx.Repo.GitRepo,

0 commit comments

Comments
 (0)