feat(wiki): page rename/move with automatic redirects #672
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
When a wiki page is renamed or moved to a different folder, automatically leave a redirect at the old location so existing links don't break. Similar to Wikipedia's page move system.
Current State
EditWikiPost()inrouters/web/repo/wiki.gohandles renames by callingwiki_service.EditWikiPage(oldName, newName, ...)Design
Redirect File
When a page is renamed, leave a file at the old path containing frontmatter:
Redirect Handling
renderViewPage(), check forredirectkey in YAML frontmatter before renderingDouble Redirect Resolution
UI
?action=_redirectslisting all redirect pages in the wikiFiles to Modify
routers/web/repo/wiki.gorenderViewPage(), redirect creation inEditWikiPost()services/wiki/wiki.goEditWikiPage()— create redirect file at old pathtemplates/repo/wiki/view.tmplWikipedia Parity
Wikipedia automatically creates redirects on page moves, preserving link integrity across millions of cross-references. This is essential for any wiki with evolving page structure.
Testing Checklist (manual UI)
redirect:frontmatter