Skip to content

Commit

Permalink
Fixing configurations relying on buggy behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Feb 1, 2017
1 parent d4c0f3a commit 590736c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion nikola/plugins/task/categories.py
Expand Up @@ -100,7 +100,11 @@ def get_classification_friendly_name(self, classification, lang, only_last_compo
def get_overview_path(self, lang, dest_type='page'):
"""A path handler for the list of all classifications."""
if self.site.config['CATEGORIES_INDEX_PATH'](lang):
return [_f for _f in [self.site.config['CATEGORIES_INDEX_PATH'](lang)] if _f], 'never'
path = self.site.config['CATEGORIES_INDEX_PATH'](lang)
if path.endswith('/index'): # TODO: remove in v8
utils.LOGGER.warn("CATEGORIES_INDEX_PATH for language {0} is missing a .html extension. Please update your configuration!".format(lang))
path += '.html'
return [_f for _f in [path] if _f], 'never'
else:
return [_f for _f in [self.site.config['CATEGORY_PATH'](lang)] if _f], 'always'

Expand Down
6 changes: 5 additions & 1 deletion nikola/plugins/task/tags.py
Expand Up @@ -104,7 +104,11 @@ def slugify_tag_name(self, name, lang):
def get_overview_path(self, lang, dest_type='page'):
"""A path handler for the list of all classifications."""
if self.site.config['TAGS_INDEX_PATH'](lang):
return [_f for _f in [self.site.config['TAGS_INDEX_PATH'](lang)] if _f], 'never'
path = self.site.config['TAGS_INDEX_PATH'](lang)
if path.endswith('/index'): # TODO: remove in v8
utils.LOGGER.warn("TAGS_INDEX_PATH for language {0} is missing a .html extension. Please update your configuration!".format(lang))
path += '.html'
return [_f for _f in [path] if _f], 'never'
else:
return [_f for _f in [self.site.config['TAG_PATH'](lang)] if _f], 'always'

Expand Down

0 comments on commit 590736c

Please sign in to comment.