From 6fcf5dfdc153596d9933fcc6aa7516551bc6408b Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 9 Aug 2019 15:51:27 -0600 Subject: [PATCH] Enable wiki page routes to handle folders Currently, there's no way for users to put pages inside folders, but that can probably be added in the future. This will allow the ~tildes.official wiki to continue working even though some of the pages have now been moved into folders to match up with the Docs site. --- tildes/tildes/routes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tildes/tildes/routes.py b/tildes/tildes/routes.py index ab5947e..2d9ce14 100644 --- a/tildes/tildes/routes.py +++ b/tildes/tildes/routes.py @@ -45,11 +45,14 @@ def includeme(config: Configurator) -> None: config.add_route("group_wiki_new_page", "/wiki/new_page", factory=group_by_path) config.add_route( - "group_wiki_page", "/wiki/{wiki_page_slug}", factory=group_wiki_page_by_slug + "group_wiki_edit_page", + "/wiki/{wiki_page_slug:.*?}/edit", + factory=group_wiki_page_by_slug, ) + config.add_route( - "group_wiki_edit_page", - "/wiki/{wiki_page_slug}/edit", + "group_wiki_page", + "/wiki/{wiki_page_slug:.*}", factory=group_wiki_page_by_slug, )