diff options
author | 2021-03-27 12:42:07 +0800 | |
---|---|---|
committer | 2021-03-27 12:42:07 +0800 | |
commit | 624e87d15ccfbe4ba2410dcaab0b4fb494b664e5 (patch) | |
tree | b2ac7802499d296af35df2ff0ebc457d7e9384e3 /pydis_site/apps/content/views | |
parent | Merge pull request #393 from ks129/guides-app (diff) |
Improve content page and listing metadata keys.
Make category `title` consistent with page `title`.
Simplify `icon` key, since there is no benefit to defining the icon
class and the icon separately.
Allow overriding the `icon` for category entries just like page entries.
Diffstat (limited to 'pydis_site/apps/content/views')
-rw-r--r-- | pydis_site/apps/content/views/page_category.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pydis_site/apps/content/views/page_category.py b/pydis_site/apps/content/views/page_category.py index eec4e7e5..723c5ad0 100644 --- a/pydis_site/apps/content/views/page_category.py +++ b/pydis_site/apps/content/views/page_category.py @@ -38,8 +38,9 @@ class PageOrCategoryView(TemplateView): context["pages"] = utils.get_category_pages(self.full_location) category = utils.get_category(self.full_location) - context["page_title"] = category["name"] + context["page_title"] = category["title"] context["page_description"] = category["description"] + context["icon"] = category.get("icon") context["path"] = f"{self.location}/" # Add trailing slash here to simplify template elif self.full_location.with_suffix(".md").is_file(): @@ -53,7 +54,7 @@ class PageOrCategoryView(TemplateView): context["breadcrumb_items"] = [ { - "name": utils.get_category(settings.PAGES_PATH / location)["name"], + "name": utils.get_category(settings.PAGES_PATH / location)["title"], "path": str(location) } for location in reversed(self.location.parents) ] |