diff options
author | 2021-03-23 18:24:56 +0800 | |
---|---|---|
committer | 2021-03-23 18:38:42 +0800 | |
commit | 367ba267c4dbc6d406922f80bc4337ee9a0139a0 (patch) | |
tree | e845e88356d37f424a8bdf002b9e6fb5f4dec83f /pydis_site/apps/content/views/pages.py | |
parent | Simplify relevant_links configuration in markdown. (diff) |
Rename `articles` to `pages`.
Articles was a good name, but we want an `articles` category in
the future. `/pages/guides/` and `/pages/articles/` are clearer in name
than `/articles/guides/` and `/articles/articles/`.
Diffstat (limited to 'pydis_site/apps/content/views/pages.py')
-rw-r--r-- | pydis_site/apps/content/views/pages.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pydis_site/apps/content/views/pages.py b/pydis_site/apps/content/views/pages.py new file mode 100644 index 00000000..11ac0eeb --- /dev/null +++ b/pydis_site/apps/content/views/pages.py @@ -0,0 +1,16 @@ +from django.views.generic import TemplateView + +from pydis_site.apps.content.utils import get_pages, get_categories + + +class PagesView(TemplateView): + """Shows all pages and categories.""" + + template_name = "content/listing.html" + + def get_context_data(self, **kwargs) -> dict: + """Add page and category data to template context.""" + context = super().get_context_data(**kwargs) + context["content"] = get_pages() + context["categories"] = get_categories() + return context |