feat: allow _Sidebar.md to override auto-generated wiki sidebar #664
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Currently the wiki sidebar navigation is auto-generated from the page list. Add support for an optional
_Sidebar.mdfile that, when present, overrides the auto-generated sidebar with custom markdown content.This is useful for fringe cases where the wiki author wants full control over sidebar navigation structure.
Current Behavior
routers/web/repo/wiki.go): Already checks for_Sidebarcontent and renders it asWikiSidebarHTML, but the template may still show the auto-generated tree alongside itrouters/web/org/wiki.go): Already renders_Sidebar.mdcontent intoWikiSidebarHTML(lines 133-143), but the auto-generated page list is always shownDesired Behavior
_Sidebar.mdexists in the wiki → render its content as the sidebar, hide the auto-generated page list/tree_Sidebar.mddoes not exist → show the auto-generated sidebar (current default behavior)Files to Modify
routers/web/repo/wiki.go— set a flag likeWikiHasCustomSidebarwhen_Sidebarcontent is foundrouters/web/org/wiki.go— same flagtemplates/repo/wiki/view.tmpl— conditionally hide auto-generated tree when custom sidebar existstemplates/org/wiki/view.tmpl— same conditionalSuperseded by #680 (folder-based tree sidebar with _Sidebar.md override). The org wiki template now shows the auto-generated collapsible tree when no _Sidebar.md exists, and renders _Sidebar.md content when present.