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