aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site')
-rw-r--r--pydis_site/apps/home/resources/books/_category_info.yaml (renamed from pydis_site/apps/home/resources/books/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/communities/_category_info.yaml (renamed from pydis_site/apps/home/resources/communities/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/editors/_category_info.yaml (renamed from pydis_site/apps/home/resources/editors/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/ides/_category_info.yaml (renamed from pydis_site/apps/home/resources/ides/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml (renamed from pydis_site/apps/home/resources/interactive_learning_tools/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/misc/_category_info.yaml (renamed from pydis_site/apps/home/resources/misc/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/podcasts/_category_info.yaml (renamed from pydis_site/apps/home/resources/podcasts/category_info.yaml)0
-rw-r--r--pydis_site/apps/home/resources/tutorials/_category_info.yaml (renamed from pydis_site/apps/home/resources/tutorials/category_info.yaml)0
-rw-r--r--pydis_site/utils/resources.py14
9 files changed, 12 insertions, 2 deletions
diff --git a/pydis_site/apps/home/resources/books/category_info.yaml b/pydis_site/apps/home/resources/books/_category_info.yaml
index e3b89ad3..e3b89ad3 100644
--- a/pydis_site/apps/home/resources/books/category_info.yaml
+++ b/pydis_site/apps/home/resources/books/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/communities/category_info.yaml b/pydis_site/apps/home/resources/communities/_category_info.yaml
index eccb8b80..eccb8b80 100644
--- a/pydis_site/apps/home/resources/communities/category_info.yaml
+++ b/pydis_site/apps/home/resources/communities/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/editors/category_info.yaml b/pydis_site/apps/home/resources/editors/_category_info.yaml
index f8dc1413..f8dc1413 100644
--- a/pydis_site/apps/home/resources/editors/category_info.yaml
+++ b/pydis_site/apps/home/resources/editors/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/ides/category_info.yaml b/pydis_site/apps/home/resources/ides/_category_info.yaml
index d331c95d..d331c95d 100644
--- a/pydis_site/apps/home/resources/ides/category_info.yaml
+++ b/pydis_site/apps/home/resources/ides/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/interactive_learning_tools/category_info.yaml b/pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml
index 08501627..08501627 100644
--- a/pydis_site/apps/home/resources/interactive_learning_tools/category_info.yaml
+++ b/pydis_site/apps/home/resources/interactive_learning_tools/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/misc/category_info.yaml b/pydis_site/apps/home/resources/misc/_category_info.yaml
index 4fdc4bf7..4fdc4bf7 100644
--- a/pydis_site/apps/home/resources/misc/category_info.yaml
+++ b/pydis_site/apps/home/resources/misc/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/podcasts/category_info.yaml b/pydis_site/apps/home/resources/podcasts/_category_info.yaml
index a0f9025c..a0f9025c 100644
--- a/pydis_site/apps/home/resources/podcasts/category_info.yaml
+++ b/pydis_site/apps/home/resources/podcasts/_category_info.yaml
diff --git a/pydis_site/apps/home/resources/tutorials/category_info.yaml b/pydis_site/apps/home/resources/tutorials/_category_info.yaml
index a9adc106..a9adc106 100644
--- a/pydis_site/apps/home/resources/tutorials/category_info.yaml
+++ b/pydis_site/apps/home/resources/tutorials/_category_info.yaml
diff --git a/pydis_site/utils/resources.py b/pydis_site/utils/resources.py
index 582df7f7..875c0dc9 100644
--- a/pydis_site/utils/resources.py
+++ b/pydis_site/utils/resources.py
@@ -14,6 +14,9 @@ class URL:
class Resource:
+ """
+ A class representing a resource on the resource page
+ """
description: str
name: str
payment: str
@@ -40,6 +43,9 @@ class Resource:
class Category:
+ """
+ A class representing a resource on the resources page
+ """
resources: typing.List[Resource]
name: str
description: str
@@ -51,7 +57,7 @@ class Category:
def construct_from_directory(cls, directory: str) -> Category: # noqa
category = cls()
- with open(f"{directory}/category_info.yaml") as category_info:
+ with open(f"{directory}/_category_info.yaml") as category_info:
category_data = yaml.safe_load(category_info)
category.__dict__.update(category_data)
@@ -59,7 +65,7 @@ class Category:
category.resources = []
for resource in glob.glob(f"{directory}/*.yaml"):
- if resource == f"{directory}/category_info.yaml":
+ if resource == f"{directory}/_category_info.yaml":
continue
with open(resource) as res_file:
@@ -71,6 +77,10 @@ class Category:
def load_categories(order: typing.List[str]) -> typing.List[Category]:
+ """
+ Load the categories specified in the order list and return them
+ as a list.
+ """
categories = []
for cat in order:
direc = "pydis_site/apps/home/resources/" + cat