From 3931b8fc83c7a0b4f6160e349a3c406d328ed380 Mon Sep 17 00:00:00 2001 From: Aly Sewelam Date: Mon, 24 Nov 2025 11:52:28 +0200 Subject: [PATCH] Add .org file detection to WikiRaw function --- routers/web/repo/wiki.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go index af6dc5cefb..d82611a5ba 100644 --- a/routers/web/repo/wiki.go +++ b/routers/web/repo/wiki.go @@ -669,8 +669,15 @@ func WikiRaw(ctx *context.Context) { } if entry == nil { - // Try to find a wiki page with that name - providedGitPath = strings.TrimSuffix(providedGitPath, ".md") + // Try to find a wiki page with that name (check both .md and .org) + providedGitPath := strings.TrimSuffix(providedGitPath, ".md") + // Try .org version + orgPath := providedGitPath + ".org" + entry, err = findEntryForFile(commit, orgPath) + if err != nil && !git.IsErrNotExist(err) { + ctx.ServerError("findFile", err) + return + } entry, err = findEntryForFile(commit, providedGitPath) if err != nil && !git.IsErrNotExist(err) { ctx.ServerError("findFile", err)