1. Ronny Pfannschmidt
  2. pelican-hacks

Commits

Alexis Metaireau  committed c888a94

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

  • Participants
  • Parent commits 5e88b07
  • Branches default

Comments (0)

Files changed (2)

File pelican/processors.py

View file
                 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)
 

File pelican/settings.py

View file
                    'SITENAME': 'A Pelican Blog',
                    'DISPLAY_PAGES_ON_MENU': True,
                    'PDF_PROCESSOR': False,
+                   'DEFAULT_CATEGORY': 'misc',
                   }
 
 def read_settings(filename):