From ec609ae562a5df9ad18d4a001279d05cc9abf54f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 17 Feb 2024 19:44:45 +0000 Subject: [PATCH] Add redirect view for old pages listing --- website/legacy/urls.py | 1 + website/legacy/views.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/website/legacy/urls.py b/website/legacy/urls.py index 6b3eedd..0befc9c 100644 --- a/website/legacy/urls.py +++ b/website/legacy/urls.py @@ -10,4 +10,5 @@ urlpatterns = [ path("tags//", views.TagView.as_view()), path("tags/", views.TagsView.as_view()), path("categories/", views.TagsView.as_view()), + path("index.json", views.PageLinksView.as_view()), ] diff --git a/website/legacy/views.py b/website/legacy/views.py index 5b2aac1..1b45a47 100644 --- a/website/legacy/views.py +++ b/website/legacy/views.py @@ -12,6 +12,12 @@ class AllPagesFeedView(RedirectView): permanent = True +@method_decorator(cache_control(max_age=60 * 60), name="dispatch") +class PageLinksView(RedirectView): + pattern_name = "api:page-links" + permanent = True + + @method_decorator(cache_control(max_age=60 * 60), name="dispatch") class TagView(RedirectView): permanent = True