From 325d7076ee7b426e50fdf513caed07536bfdb9b5 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sat, 29 Jan 2022 14:55:01 +0100 Subject: Sort all the resources alphabetically. --- pydis_site/apps/resources/views/resources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pydis_site/apps/resources/views/resources.py') diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 14b3d0bf..d0b8bae7 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -2,7 +2,7 @@ from pathlib import Path import yaml from django.core.handlers.wsgi import WSGIRequest -from django.http import HttpRequest, HttpResponse +from django.http import HttpResponse from django.shortcuts import render from django.views import View @@ -24,6 +24,9 @@ class ResourceView(View): for path in RESOURCES_PATH.rglob("*.yaml") } + # Sort the resources alphabetically + self.resources = dict(sorted(self.resources.items())) + # Parse out all current tags resource_tags = { "topics": set(), -- cgit v1.2.3