diff options
author | 2022-01-30 21:15:32 +0100 | |
---|---|---|
committer | 2022-01-30 21:15:32 +0100 | |
commit | 3b213bbdfcdf2a17c4b29692bd75094a47440cd6 (patch) | |
tree | 8c412582c2fbbf27d4de7c945a4ab9d4dd2974fb | |
parent | Kaizen: Clean up some indentation. (diff) |
Revert ugly deploy preview redirect hack.
-rw-r--r-- | pydis_site/apps/resources/urls.py | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 044f7072..ed24dc99 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -1,48 +1,9 @@ -import typing - from django_distill import distill_path from pydis_site.apps.resources import views -# This is only used for `distill_path`, so that the Netlify Deploy Previews -# can successfully redirect to static pages. This could probably be improved by -# making it less hardcoded, but since there's a bunch of special cases, and since -# it only affects deploy previews, I'm choosing to solve this with a simple solution. -VALID_RESOURCE_TYPES = [ - "book", - "books", - "reading", - "podcast", - "podcasts", - "interactive", - "videos", - "video", - "courses", - "course", - "communities", - "community", - "tutorial", - "tutorials", - "tool", - "tools", - "project ideas", - "project-ideas", -] - - -def get_all_pages() -> typing.Iterator[dict[str, str]]: - """Get all the valid options for the resource_type path selector.""" - for resource_type in VALID_RESOURCE_TYPES: - yield {"resource_type": resource_type} - - app_name = "resources" urlpatterns = [ distill_path("", views.resources.ResourceView.as_view(), name="index"), - distill_path( - "<resource_type>/", - views.resources.ResourceView.as_view(), - name="index", - distill_func=get_all_pages, - ), + distill_path("<resource_type>/", views.resources.ResourceView.as_view(), name="index"), ] |