Skip to content

Commit

Permalink
Preventing .html to be added when it shouldn't be.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jan 29, 2017
1 parent ff8e04b commit 07ed03a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion nikola/plugins/misc/taxonomies_classifier.py
Expand Up @@ -240,10 +240,12 @@ def _postprocess_path(self, path, lang, append_index='auto', dest_type='page', p
path = ['rss']
elif len(path) == 0 or append_index == 'always':
path = path + [os.path.splitext(self.site.config['INDEX_FILE'])[0]]
elif len(path) > 0 and append_index == 'never':
path[-1] = os.path.splitext(path[-1])[0]
path[-1] += force_extension
elif (self.site.config['PRETTY_URLS'] and append_index != 'never') or len(path) == 0 or append_index == 'always':
path = path + [self.site.config['INDEX_FILE']]
else:
elif append_index != 'never':
path[-1] += '.html'
# Create path
result = [_f for _f in [self.site.config['TRANSLATIONS'][lang]] + path if _f]
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/archive.py
Expand Up @@ -139,7 +139,7 @@ def get_path(self, classification, lang, dest_type='page'):
components.extend(classification)
add_index = 'always'
else:
components.append(os.path.splitext(self.site.config['ARCHIVE_FILENAME'])[0])
components.append(self.site.config['ARCHIVE_FILENAME'])
add_index = 'never'
return [_f for _f in components if _f], add_index

Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/sections.py
Expand Up @@ -100,7 +100,7 @@ def get_path(self, section, lang, dest_type='page'):
"""A path handler for the given classification."""
result = [_f for _f in [section] if _f]
if dest_type == 'rss':
return result + ['rss'], 'never'
return result + ['rss.xml'], 'never'
return result, 'always'

def provide_context_and_uptodate(self, section, lang, node=None):
Expand Down

0 comments on commit 07ed03a

Please sign in to comment.