From fc3ca7ea0e0ff2c12731b0af7c88b822f0c3d1c6 Mon Sep 17 00:00:00 2001 From: Nicolas Perriault Date: Mon, 22 Aug 2011 19:42:42 +0200 Subject: [PATCH] fixed aliased replacements were broken when using ARTICLE_PERMALINK_STRUCTURE --- pelican/generators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 605bd6f7..f375011f 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -42,7 +42,7 @@ class Generator(object): ]), extensions=self.settings.get('JINJA_EXTENSIONS', []), ) - debug('self._env.list_templates(): {0}'.format(self._env.list_templates())) + debug('self._env.list_templates(): {0}'.format(self._env.list_templates())) # get custom Jinja filters from user settings custom_filters = self.settings.get('JINJA_FILTERS', {}) @@ -236,7 +236,7 @@ class ArticlesGenerator(Generator): add_to_url = u'' if 'ARTICLE_PERMALINK_STRUCTURE' in self.settings: article_permalink_structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] - article_permalink_structure = article_permalink_structure.lstrip('/') + article_permalink_structure = article_permalink_structure.lstrip('/').replace('%(', "%%(") # try to substitute any python datetime directive add_to_url = article.date.strftime(article_permalink_structure) @@ -280,7 +280,7 @@ class ArticlesGenerator(Generator): tags = map(itemgetter(1), tag_cloud) if tags: - max_count = max(tags) + max_count = max(tags) steps = self.settings.get('TAG_CLOUD_STEPS') # calculate word sizes @@ -351,7 +351,7 @@ class StaticGenerator(Generator): final_path=None): """Copy all the paths from source to destination""" for path in paths: - copy(path, source, os.path.join(output_path, destination), final_path, + copy(path, source, os.path.join(output_path, destination), final_path, overwrite=True) def generate_output(self, writer):