mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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(
|
category = os.path.dirname(f).replace(
|
||||||
os.path.expanduser(generator.path)+'/', '')
|
os.path.expanduser(generator.path)+'/', '')
|
||||||
|
|
||||||
|
if category == generator.path:
|
||||||
|
category = context['DEFAULT_CATEGORY']
|
||||||
|
|
||||||
if category != '':
|
if category != '':
|
||||||
metadatas['category'] = unicode(category)
|
metadatas['category'] = unicode(category)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ _DEFAULT_CONFIG = {'PATH': None,
|
||||||
'SITENAME': 'A Pelican Blog',
|
'SITENAME': 'A Pelican Blog',
|
||||||
'DISPLAY_PAGES_ON_MENU': True,
|
'DISPLAY_PAGES_ON_MENU': True,
|
||||||
'PDF_PROCESSOR': False,
|
'PDF_PROCESSOR': False,
|
||||||
|
'DEFAULT_CATEGORY': 'misc',
|
||||||
}
|
}
|
||||||
|
|
||||||
def read_settings(filename):
|
def read_settings(filename):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue