diff options
author | Unknwon <u@gogs.io> | 2016-07-01 15:34:03 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-01 15:34:03 +0800 |
commit | e84ac64964dc3011e6bc12dfbe6abfad3c0f0f3d (patch) | |
tree | 41fb6538728587538d8093606bc1de9d76f2867f /routers/repo/wiki.go | |
parent | 3a30c06345df40bf407a866b049ef649dfc8a745 (diff) | |
download | gitea-e84ac64964dc3011e6bc12dfbe6abfad3c0f0f3d.tar.gz gitea-e84ac64964dc3011e6bc12dfbe6abfad3c0f0f3d.zip |
Do not show filename not have suffifx .md
Diffstat (limited to 'routers/repo/wiki.go')
-rw-r--r-- | routers/repo/wiki.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go index e0b3e692c1..a20bea25df 100644 --- a/routers/repo/wiki.go +++ b/routers/repo/wiki.go @@ -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) |