Permalink
Browse files

Default category location for cats that aren't remapped.

  • Loading branch information...
1 parent 5c2f3e1 commit bda577a3ecdf4cd3c560d3a6959d56727fbe8559 @johnboxall johnboxall committed Feb 8, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 pelican/plugins/categories.py
@@ -28,8 +28,12 @@ class Category(BaseCategory):
"""
def __init__(self, name, settings):
super(BaseCategory, self).__init__(name, settings)
- remap = settings.get("CATEGORY_MAP", {}).get(self.slug, {})
- for key, value in remap.items():
+ attributes = settings["CATEGORY_MAP"].get(self.slug, {})
+
+ if "slug" not in attributes:
+ attributes["slug"] = "blog/category/%s" % self.slug
+
+ for key, value in attributes.items():
setattr(self, key, value)

0 comments on commit bda577a

Please sign in to comment.