aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/utils.py
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2021-04-01 16:29:29 +0800
committerGravatar kosayoda <[email protected]>2021-04-01 18:04:14 +0800
commit4208626262d6cf790da1c0e00765b375fa427aa7 (patch)
tree84ccbe32dbeef7cb48c620c36b3c461605df6382 /pydis_site/apps/content/utils.py
parentAdd new tests to achieve full coverage. (diff)
Place category pages in the same directory as categories.
Diffstat (limited to 'pydis_site/apps/content/utils.py')
-rw-r--r--pydis_site/apps/content/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pydis_site/apps/content/utils.py b/pydis_site/apps/content/utils.py
index d6886ce2..d3f270ff 100644
--- a/pydis_site/apps/content/utils.py
+++ b/pydis_site/apps/content/utils.py
@@ -32,7 +32,8 @@ def get_category_pages(path: Path) -> Dict[str, Dict]:
pages = {}
for item in path.glob("*.md"):
- if item.is_file():
+ # Only list page if there is no category with the same name
+ if item.is_file() and not item.with_suffix("").is_dir():
pages[item.stem] = frontmatter.load(item).metadata
return pages