mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 23:34:11 +02:00
* fix multiple readme file rendering and fix #1657 * remove unnecessary loop
This commit is contained in:
1 parent
98548c83d3
commit
0d1e001b9c
2 files changed
+18
-3
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user