mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user