aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/apps/resources')
-rw-r--r--pydis_site/apps/resources/resources/communities/django.yaml13
-rw-r--r--pydis_site/apps/resources/resources/communities/kivy.yaml2
-rw-r--r--pydis_site/apps/resources/resources/communities/pallets.yaml2
-rw-r--r--pydis_site/apps/resources/resources/tools/ides/thonny.yaml2
-rw-r--r--pydis_site/apps/resources/urls.py22
5 files changed, 35 insertions, 6 deletions
diff --git a/pydis_site/apps/resources/resources/communities/django.yaml b/pydis_site/apps/resources/resources/communities/django.yaml
new file mode 100644
index 00000000..0ef729ba
--- /dev/null
+++ b/pydis_site/apps/resources/resources/communities/django.yaml
@@ -0,0 +1,13 @@
+description: Django is a high-level Python web framework that encourages rapid development and clean,
+ pragmatic design. Built by experienced developers, it takes care of much of the hassle of web development,
+ so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.
+title_image: https://static.djangoproject.com/img/logos/django-logo-positive.png
+title_url: https://discord.gg/M9Mx3RvKM5
+position: 5
+urls:
+ - icon: branding/discord
+ url: https://discord.gg/M9Mx3RvKM5
+ color: blurple
+ - icon: regular/link
+ url: https://www.djangoproject.com/
+ color: teal
diff --git a/pydis_site/apps/resources/resources/communities/kivy.yaml b/pydis_site/apps/resources/resources/communities/kivy.yaml
index 601d7dba..69f117c7 100644
--- a/pydis_site/apps/resources/resources/communities/kivy.yaml
+++ b/pydis_site/apps/resources/resources/communities/kivy.yaml
@@ -5,7 +5,7 @@ icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kiv
icon_size: 50
title_image: https://i.imgur.com/EVP3jZR.png
title_url: https://discord.gg/djPtTRJ
-position: 5
+position: 6
urls:
- icon: branding/discord
url: https://discord.gg/djPtTRJ
diff --git a/pydis_site/apps/resources/resources/communities/pallets.yaml b/pydis_site/apps/resources/resources/communities/pallets.yaml
index 239b1491..64c97dab 100644
--- a/pydis_site/apps/resources/resources/communities/pallets.yaml
+++ b/pydis_site/apps/resources/resources/communities/pallets.yaml
@@ -3,7 +3,7 @@ description: The Pallets Projects develop Python libraries such as the Flask web
and get help from the Pallets community.
title_image: https://i.imgur.com/sV9Ypdf.png
title_url: https://discord.gg/t6rrQZH
-position: 6
+position: 7
urls:
- icon: branding/discord
url: https://discord.gg/t6rrQZH
diff --git a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml b/pydis_site/apps/resources/resources/tools/ides/thonny.yaml
index 3581e1cd..d7f03a74 100644
--- a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml
+++ b/pydis_site/apps/resources/resources/tools/ides/thonny.yaml
@@ -1,4 +1,4 @@
-description: A Python IDE specifially aimed at learning programming. Has a lot of
+description: A Python IDE specifically aimed at learning programming. Has a lot of
helpful features to help you understand your code.
name: Thonny
title_url: https://thonny.org/
diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py
index 19142081..10eda132 100644
--- a/pydis_site/apps/resources/urls.py
+++ b/pydis_site/apps/resources/urls.py
@@ -1,9 +1,25 @@
-from django.urls import path
+import typing
+from pathlib import Path
+
+from django_distill import distill_path
from pydis_site.apps.resources import views
app_name = "resources"
+
+
+def get_all_resources() -> typing.Iterator[dict[str, str]]:
+ """Yield a dict of all resource categories."""
+ for category in Path("pydis_site", "apps", "resources", "resources").iterdir():
+ yield {"category": category.name}
+
+
urlpatterns = [
- path("", views.ResourcesView.as_view(), name="index"),
- path("<str:category>/", views.ResourcesListView.as_view(), name="resources")
+ distill_path("", views.ResourcesView.as_view(), name="index"),
+ distill_path(
+ "<str:category>/",
+ views.ResourcesListView.as_view(),
+ name="resources",
+ distill_func=get_all_resources
+ ),
]