Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Default category location for cats that aren't remapped.

  • Loading branch information...
commit bda577a3ecdf4cd3c560d3a6959d56727fbe8559 1 parent 5c2f3e1
John Boxall johnboxall authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 2 pelican/plugins/categories.py
8 pelican/plugins/categories.py
@@ -28,8 +28,12 @@ class Category(BaseCategory):
28 28 """
29 29 def __init__(self, name, settings):
30 30 super(BaseCategory, self).__init__(name, settings)
31   - remap = settings.get("CATEGORY_MAP", {}).get(self.slug, {})
32   - for key, value in remap.items():
  31 + attributes = settings["CATEGORY_MAP"].get(self.slug, {})
  32 +
  33 + if "slug" not in attributes:
  34 + attributes["slug"] = "blog/category/%s" % self.slug
  35 +
  36 + for key, value in attributes.items():
33 37 setattr(self, key, value)
34 38
35 39

0 comments on commit bda577a

Please sign in to comment.
Something went wrong with that request. Please try again.