|
|
@ -64,7 +64,7 @@ func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, str |
|
|
|
} |
|
|
|
} |
|
|
|
pages := make([]PageMeta, 0, len(entries)) |
|
|
|
pages := make([]PageMeta, 0, len(entries)) |
|
|
|
for i := range entries { |
|
|
|
for i := range entries { |
|
|
|
if entries[i].Type == git.OBJECT_BLOB { |
|
|
|
if entries[i].Type == git.OBJECT_BLOB && strings.HasSuffix(entries[i].Name(), ".md") { |
|
|
|
name := strings.TrimSuffix(entries[i].Name(), ".md") |
|
|
|
name := strings.TrimSuffix(entries[i].Name(), ".md") |
|
|
|
pages = append(pages, PageMeta{ |
|
|
|
pages = append(pages, PageMeta{ |
|
|
|
Name: name, |
|
|
|
Name: name, |
|
|
@ -167,7 +167,7 @@ func WikiPages(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
pages := make([]PageMeta, 0, len(entries)) |
|
|
|
pages := make([]PageMeta, 0, len(entries)) |
|
|
|
for i := range entries { |
|
|
|
for i := range entries { |
|
|
|
if entries[i].Type == git.OBJECT_BLOB { |
|
|
|
if entries[i].Type == git.OBJECT_BLOB && strings.HasSuffix(entries[i].Name(), ".md") { |
|
|
|
c, err := wikiRepo.GetCommitByPath(entries[i].Name()) |
|
|
|
c, err := wikiRepo.GetCommitByPath(entries[i].Name()) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetCommit", err) |
|
|
|
ctx.Handle(500, "GetCommit", err) |
|
|
|