diff --git a/README.md b/README.md index 048a25690..791050ffb 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.116 (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.117 (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 03b762bb3..64d9e3086 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.116.0124" +const APP_VER = "0.9.117.0125" func init() { setting.AppVer = APP_VER diff --git a/modules/template/highlight/highlight.go b/modules/template/highlight/highlight.go index bbf08e043..618b6ff0b 100644 --- a/modules/template/highlight/highlight.go +++ b/modules/template/highlight/highlight.go @@ -61,7 +61,9 @@ var ( } // Extensions that are not same as highlight classes. - highlightMapping = map[string]string{} + highlightMapping = map[string]string{ + ".txt": "nohighlight", + } ) func NewContext() { diff --git a/public/config.codekit b/public/config.codekit index c37b21157..b4548fd81 100644 --- a/public/config.codekit +++ b/public/config.codekit @@ -20,11 +20,11 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, - "\/css\/semantic-2.2.1.min.css": { + "\/css\/semantic-2.2.7.min.css": { "fileType": 16, - "ignore": 0, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/css\/semantic-2.2.1.min.css", + "ignore": 1, + "ignoreWasSetByUser": 1, + "inputAbbreviatedPath": "\/css\/semantic-2.2.7.min.css", "outputAbbreviatedPath": "No Output Path", "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 @@ -150,12 +150,12 @@ "outputStyle": 1, "syntaxCheckerStyle": 1 }, - "\/js\/semantic-2.2.1.min.js": { + "\/js\/semantic-2.2.7.min.js": { "fileType": 64, "ignore": 1, "ignoreWasSetByUser": 1, - "inputAbbreviatedPath": "\/js\/semantic-2.2.1.min.js", - "outputAbbreviatedPath": "\/js\/min\/semantic-2.2.1.min-min.js", + "inputAbbreviatedPath": "\/js\/semantic-2.2.7.min.js", + "outputAbbreviatedPath": "\/js\/min\/semantic-2.2.7.min-min.js", "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0, "outputStyle": 1, diff --git a/public/css/gogs.css b/public/css/gogs.css index 3832c30f8..ab8c65697 100644 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1303,7 +1303,11 @@ footer .ui.language .menu { max-width: 100%; } .repository.file.list #file-content .view-raw img { - padding: 5px 5px 0 5px; + margin-bottom: -5px; +} +.repository.file.list #file-content .plain-text { + font-size: 14px; + padding: 10px 15px; } .repository.file.list #file-content .code-view * { font-size: 12px; diff --git a/public/less/_repository.less b/public/less/_repository.less index 9f51ebc4f..366c92c43 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -247,10 +247,14 @@ max-width: 100%; } img { - padding: 5px 5px 0 5px; + margin-bottom: -5px; } } + .plain-text { + font-size: 14px; + padding: 10px 15px; + } .code-view { * { font-size: 12px; diff --git a/routers/repo/view.go b/routers/repo/view.go index 2c17ed8d0..5fc38fb20 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -79,9 +79,8 @@ func renderDirectory(ctx *context.Context, treeLink string) { buf = buf[:n] isTextFile := base.IsTextFile(buf) - ctx.Data["FileIsText"] = isTextFile + ctx.Data["IsTextFile"] = isTextFile ctx.Data["FileName"] = readmeFile.Name() - // FIXME: what happens when README file is an image? if isTextFile { d, _ := ioutil.ReadAll(dataRc) buf = append(buf, d...) @@ -156,10 +155,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st isMarkdown := markdown.IsMarkdownFile(blob.Name()) ctx.Data["IsMarkdown"] = isMarkdown - readmeExist := isMarkdown || markdown.IsReadmeFile(blob.Name()) + readmeExist := isMarkdown && markdown.IsReadmeFile(blob.Name()) ctx.Data["ReadmeExist"] = readmeExist if readmeExist { - // TODO: don't need to render if it's a README but not Markdown file. 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 d66ae3bf4..5d19b0cfb 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.116.0124 \ No newline at end of file +0.9.117.0125 \ No newline at end of file diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 08d77c3f3..77f472325 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -36,8 +36,8 @@ {{end}}
-
- {{if .IsMarkdown}} +
+ {{if or .IsMarkdown .ReadmeInList}} {{if .FileContent}}{{.FileContent | Str2html}}{{end}} {{else if not .IsTextFile}}
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 0881ce993..f532dd742 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -52,6 +52,6 @@ {{end}} -{{if .ReadmeExist}} +{{if and .ReadmeExist .IsTextFile}} {{template "repo/view_file" .}} {{end}}