Skip to content
Permalink
Browse files

Preventing .html to be added when it shouldn't be.

  • Loading branch information
felixfontein committed Jan 29, 2017
1 parent ff8e04b commit 07ed03a701a5ddbdb58821b25794b4cf092fa423
@@ -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]
@@ -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

@@ -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):

0 comments on commit 07ed03a

Please sign in to comment.
You can’t perform that action at this time.