Prechádzať zdrojové kódy

Fix template error when rendering non-README markdown (#4063)

Unknwon 8 rokov pred
rodič
commit
a2f2f7717a
4 zmenil súbory, kde vykonal 5 pridanie a 6 odobranie
  1. 1 1
      README.md
  2. 1 1
      gogs.go
  3. 2 3
      routers/repo/view.go
  4. 1 1
      templates/.VERSION

+ 1 - 1
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  |
 |:-------------:|:-------:|:-------:|

+ 1 - 1
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

+ 2 - 3
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.

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.9.119.0126
+0.9.120.0127