Skip to content

Commit

Permalink
handle missing folders better
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Dec 24, 2015
1 parent ce07d6b commit f0aac44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nikola/nikola.py
Expand Up @@ -1297,11 +1297,11 @@ def _register_templated_shortcodes(self):
"""Register shortcodes provided by templates in shortcodes/ folders."""

builtin_sc_dir = resource_filename('nikola', os.path.join('data', 'shortcodes', utils.get_template_engine(self.THEMES)))
sc_dirs = [builtin_sc_dir]
if os.path.isdir('shortcodes'):
sc_dirs.append('shortcodes')
sc_dirs = [builtin_sc_dir, 'shortcodes']

for sc_dir in sc_dirs:
if not os.path.isdir(sc_dir):
continue
for fname in os.listdir(sc_dir):
name, ext = os.path.splitext(fname)
if ext == '.tmpl':
Expand Down

0 comments on commit f0aac44

Please sign in to comment.