1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

fix multiple readme file rendering and fix #1657 (#1658)

* fix multiple readme file rendering and fix #1657

* remove unnecessary loop
This commit is contained in:
Lunny Xiao
2017-05-02 16:57:54 +08:00
committed by Bo-Yi Wu
parent 98548c83d3
commit 0d1e001b9c
2 changed files with 18 additions and 3 deletions

View File

@@ -56,13 +56,19 @@ func renderDirectory(ctx *context.Context, treeLink string) {
var readmeFile *git.Blob
for _, entry := range entries {
if entry.IsDir() || !markup.IsReadmeFile(entry.Name()) {
if entry.IsDir() {
continue
}
tp, ok := markup.ReadmeFileType(entry.Name())
if !ok {
continue
}
// TODO: collect all possible README files and show with priority.
readmeFile = entry.Blob()
break
if tp != "" {
break
}
}
if readmeFile != nil {