summaryrefslogtreecommitdiffstats
path: root/routers/repo/wiki.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-04 21:30:33 -0500
committerUnknwon <u@gogs.io>2015-12-04 21:30:33 -0500
commite538ff27704cddb1a99efc1a6be19e134f97355f (patch)
tree88f93b17d47aeb3ac4dd0692f5c5b613ee38b28b /routers/repo/wiki.go
parent76d4b9288b60ed6c037257415a570225764ff0a0 (diff)
downloadgitea-e538ff27704cddb1a99efc1a6be19e134f97355f.tar.gz
gitea-e538ff27704cddb1a99efc1a6be19e134f97355f.zip
fix #1829 and fix #890
Diffstat (limited to 'routers/repo/wiki.go')
-rw-r--r--routers/repo/wiki.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go
index 0fdd76d784..5e160518a0 100644
--- a/routers/repo/wiki.go
+++ b/routers/repo/wiki.go
@@ -24,6 +24,12 @@ const (
WIKI_PAGES base.TplName = "repo/wiki/pages"
)
+func MustEnableWiki(ctx *middleware.Context) {
+ if !ctx.Repo.Repository.EnableWiki {
+ ctx.Handle(404, "MustEnableWiki", nil)
+ }
+}
+
type PageMeta struct {
Name string
URL string
@@ -94,7 +100,7 @@ func renderWikiPage(ctx *middleware.Context, isViewPage bool) (*git.Repository,
return nil, ""
}
if isViewPage {
- ctx.Data["content"] = string(base.RenderMarkdown(data, ctx.Repo.RepoLink))
+ ctx.Data["content"] = string(base.RenderMarkdown(data, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas()))
} else {
ctx.Data["content"] = string(data)
}