Do not show filename not have suffifx .md
This commit is contained in:
parent
3a30c06345
commit
e84ac64964
5 changed files with 7 additions and 7 deletions
|
@ -64,7 +64,7 @@ func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, str
|
|||
}
|
||||
pages := make([]PageMeta, 0, len(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")
|
||||
pages = append(pages, PageMeta{
|
||||
Name: name,
|
||||
|
@ -167,7 +167,7 @@ func WikiPages(ctx *context.Context) {
|
|||
}
|
||||
pages := make([]PageMeta, 0, len(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())
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetCommit", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue