summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-06-08 09:59:16 +0100
committerGitHub <noreply@github.com>2022-06-08 16:59:16 +0800
commitac88f21ecc5612befe51f7ab6ffcb76c681daba5 (patch)
treecbe281221d0703da0f1ecce428888e036ef311d7 /routers
parentc1c07e533c9ca3be13b4af057b6b989402c12f6e (diff)
downloadgitea-ac88f21ecc5612befe51f7ab6ffcb76c681daba5.tar.gz
gitea-ac88f21ecc5612befe51f7ab6ffcb76c681daba5.zip
Automatically render wiki TOC (#19873)
Automatically add sidebar in the wiki view containing a TOC for the wiki page. Make the TOC collapsable Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/wiki.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go
index 77f60a1dfa..f4aabbf480 100644
--- a/routers/web/repo/wiki.go
+++ b/routers/web/repo/wiki.go
@@ -280,6 +280,8 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
ctx.Data["footerPresent"] = false
}
+ ctx.Data["toc"] = rctx.TableOfContents
+
// get commit count - wiki revisions
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
ctx.Data["CommitCount"] = commitsCount