mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 12:22:11 +00:00
parent
76d4b9288b
commit
e538ff2770
25 changed files with 248 additions and 94 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue