1
0
Fork 0
forked from github/pelican

Fallback to default category if no category is detected (for articles)

This commit is contained in:
Alexis Metaireau 2010-11-07 14:35:10 +00:00
commit 29395965b6
2 changed files with 4 additions and 0 deletions

View file

@ -69,6 +69,9 @@ class ArticlesProcessor(Processor):
category = os.path.dirname(f).replace(
os.path.expanduser(generator.path)+'/', '')
if category == generator.path:
category = context['DEFAULT_CATEGORY']
if category != '':
metadatas['category'] = unicode(category)