Merge pull request #163 from n1k0/master

fixed aliased replacements were broken when using ARTICLE_PERMALINK_STRUCTURE
This commit is contained in:
Alexis Metaireau 2011-08-22 11:33:49 -07:00
commit 56749af1da

View file

@ -236,7 +236,7 @@ class ArticlesGenerator(Generator):
add_to_url = u'' add_to_url = u''
if 'ARTICLE_PERMALINK_STRUCTURE' in self.settings: if 'ARTICLE_PERMALINK_STRUCTURE' in self.settings:
article_permalink_structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] 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 # try to substitute any python datetime directive
add_to_url = article.date.strftime(article_permalink_structure) add_to_url = article.date.strftime(article_permalink_structure)
@ -280,7 +280,7 @@ class ArticlesGenerator(Generator):
tags = map(itemgetter(1), tag_cloud) tags = map(itemgetter(1), tag_cloud)
if tags: if tags:
max_count = max(tags) max_count = max(tags)
steps = self.settings.get('TAG_CLOUD_STEPS') steps = self.settings.get('TAG_CLOUD_STEPS')
# calculate word sizes # calculate word sizes