From 6cd4a19ed6e19da44b88b07ab060a3a7edd3e9af Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 6 Jun 2026 15:51:24 -0500 Subject: [PATCH] fix(wiki): render folder listing template instead of start page When navigating to a wiki folder with no index file, Wiki() handler now renders the wiki view template with IsWikiFolder flag instead of falling back to the empty wiki start page. --- routers/web/repo/wiki.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go index 25286fbd67..6150d83aa6 100644 --- a/routers/web/repo/wiki.go +++ b/routers/web/repo/wiki.go @@ -530,6 +530,14 @@ func Wiki(ctx *context.Context) { if ctx.Written() { return } + // Folder listing - no entry but IsWikiFolder flag is set + if ctx.Data["IsWikiFolder"] != nil { + if wikiGitRepo != nil { + defer wikiGitRepo.Close() + } + ctx.HTML(http.StatusOK, tplWikiView) + return + } if entry == nil { ctx.Data["Title"] = ctx.Tr("repo.wiki") ctx.HTML(http.StatusOK, tplWikiStart) -- 2.52.0