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)

View file

@ -12,6 +12,7 @@ _DEFAULT_CONFIG = {'PATH': None,
'SITENAME': 'A Pelican Blog',
'DISPLAY_PAGES_ON_MENU': True,
'PDF_PROCESSOR': False,
'DEFAULT_CATEGORY': 'misc',
}
def read_settings(filename):