forked from github/pelican
Fallback to default category if no category is detected (for articles)
This commit is contained in:
parent
101d171bf7
commit
29395965b6
2 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue