feat: added support for making profile urls to be top-level

Made the profile_url_prefix customizable by adding it in the hooks.

Issue #192
This commit is contained in:
Anand Chitipothu
2021-09-07 15:44:55 +05:30
parent f52e5067b6
commit 035a674cff
2 changed files with 110 additions and 3 deletions

View File

@@ -141,15 +141,16 @@ website_route_rules = [
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
{"from_route": "/user/<string(minlength=4):username>", "to_route": "profiles/profile"},
]
website_redirects = [
{"source": "/update-profile", "target": "/edit-profile"},
]
update_website_context = 'community.widgets.update_website_context'
update_website_context = [
'community.widgets.update_website_context',
'community.page_renderers.update_website_context'
]
## Specify the additional tabs to be included in the user profile page.
## Each entry must be a subclass of community.community.plugins.ProfileTab
# profile_tabs = []
@@ -170,3 +171,11 @@ community_markdown_macro_renderers = {
"YouTubeVideo": "community.plugins.youtube_video_renderer",
"Video": "community.plugins.video_renderer"
}
# page_renderer to manage profile pages
page_renderer = [
"community.page_renderers.ProfilePage"
]
# set this to "/" to have profiles on the top-level
profile_url_prefix = "/users/"