aboutsummaryrefslogtreecommitdiff
path: root/routers/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/single.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index eda71f29..ce4a683c 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -104,7 +104,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
} else if blob, err := readmeFile.LookupBlob(); err != nil {
ctx.Data["FileIsLarge"] = true
} else {
- ctx.Data["ReadmeContent"] = string(base.RenderMarkdown(blob.Contents()))
+ // current repo branch link
+ urlPrefix := "http://" + base.Domain + "/" + ctx.Repo.Owner.LowerName + "/" +
+ ctx.Repo.Repository.Name + "/blob/" + params["branchname"]
+
+ ctx.Data["ReadmeContent"] = string(base.RenderMarkdown(blob.Contents(), urlPrefix))
}
}