Skip to content

Commit 590736c

Browse files
committedFeb 1, 2017
Fixing configurations relying on buggy behavior.
1 parent d4c0f3a commit 590736c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎nikola/plugins/task/categories.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ def get_classification_friendly_name(self, classification, lang, only_last_compo
100100
def get_overview_path(self, lang, dest_type='page'):
101101
"""A path handler for the list of all classifications."""
102102
if self.site.config['CATEGORIES_INDEX_PATH'](lang):
103-
return [_f for _f in [self.site.config['CATEGORIES_INDEX_PATH'](lang)] if _f], 'never'
103+
path = self.site.config['CATEGORIES_INDEX_PATH'](lang)
104+
if path.endswith('/index'): # TODO: remove in v8
105+
utils.LOGGER.warn("CATEGORIES_INDEX_PATH for language {0} is missing a .html extension. Please update your configuration!".format(lang))
106+
path += '.html'
107+
return [_f for _f in [path] if _f], 'never'
104108
else:
105109
return [_f for _f in [self.site.config['CATEGORY_PATH'](lang)] if _f], 'always'
106110

‎nikola/plugins/task/tags.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ def slugify_tag_name(self, name, lang):
104104
def get_overview_path(self, lang, dest_type='page'):
105105
"""A path handler for the list of all classifications."""
106106
if self.site.config['TAGS_INDEX_PATH'](lang):
107-
return [_f for _f in [self.site.config['TAGS_INDEX_PATH'](lang)] if _f], 'never'
107+
path = self.site.config['TAGS_INDEX_PATH'](lang)
108+
if path.endswith('/index'): # TODO: remove in v8
109+
utils.LOGGER.warn("TAGS_INDEX_PATH for language {0} is missing a .html extension. Please update your configuration!".format(lang))
110+
path += '.html'
111+
return [_f for _f in [path] if _f], 'never'
108112
else:
109113
return [_f for _f in [self.site.config['TAG_PATH'](lang)] if _f], 'always'
110114

0 commit comments

Comments
 (0)
Please sign in to comment.