summaryrefslogtreecommitdiffstats
path: root/routers/repo/wiki.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-01 15:34:03 +0800
committerUnknwon <u@gogs.io>2016-07-01 15:34:03 +0800
commite84ac64964dc3011e6bc12dfbe6abfad3c0f0f3d (patch)
tree41fb6538728587538d8093606bc1de9d76f2867f /routers/repo/wiki.go
parent3a30c06345df40bf407a866b049ef649dfc8a745 (diff)
downloadgitea-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.go4
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)