aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-01-27 16:52:19 -0500
committerUnknwon <u@gogs.io>2017-01-27 16:52:19 -0500
commita2f2f7717ac7bcc887da3771adfefe67c346c512 (patch)
treecb1244006fc42aff81e6d492ff0a7b35bdd0168a
parent740192564b9d2c14e61cc1ebf910123c3bcbfbc3 (diff)
Fix template error when rendering non-README markdown (#4063)
-rw-r--r--README.md2
-rw-r--r--gogs.go2
-rw-r--r--routers/repo/view.go5
-rw-r--r--templates/.VERSION2
4 files changed, 5 insertions, 6 deletions
diff --git a/README.md b/README.md
index 34bd0bf4..dcae1f1a 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
-##### Current tip version: 0.9.119 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~)
+##### Current tip version: 0.9.120 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~)
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
diff --git a/gogs.go b/gogs.go
index b85b3e55..1bc230d1 100644
--- a/gogs.go
+++ b/gogs.go
@@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.9.119.0126"
+const APP_VER = "0.9.120.0127"
func init() {
setting.AppVer = APP_VER
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 5fc38fb2..c6bf4b90 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -154,10 +154,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
isMarkdown := markdown.IsMarkdownFile(blob.Name())
ctx.Data["IsMarkdown"] = isMarkdown
+ ctx.Data["ReadmeExist"] = isMarkdown && markdown.IsReadmeFile(blob.Name())
- readmeExist := isMarkdown && markdown.IsReadmeFile(blob.Name())
- ctx.Data["ReadmeExist"] = readmeExist
- if readmeExist {
+ if isMarkdown {
ctx.Data["FileContent"] = string(markdown.Render(buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas()))
} else {
// Building code view blocks with line number on server side.
diff --git a/templates/.VERSION b/templates/.VERSION
index b07020d9..67aeeccb 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.9.119.0126 \ No newline at end of file
+0.9.120.0127 \ No newline at end of file