From e29b54e5e079594fb3516b276ce2e1553108bf9d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 16 Apr 2012 09:10:20 -0700 Subject: [PATCH 1/2] Replace omitted slash in feed URL generation This slash was originally present, but I removed it at some point because it was causing double-slashes. I believe the reason is that I had a leading slash in my article URL pattern, which in retrospect should not have been there. Omitting the slash caused problems for other folks; I should have tested this better. This commit puts the slash back where it belongs. --- pelican/writers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/writers.py b/pelican/writers.py index faca46bd..4dd04a2a 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -36,7 +36,7 @@ class Writer(object): feed.add_item( title=item.title, - link='%s%s' % (self.site_url, item.url), + link='%s/%s' % (self.site_url, item.url), unique_id='tag:%s,%s:%s' % (self.site_url.replace('http://', ''), item.date.date(), item.url), description=item.content, From 602990b80e403ec2cb8021575aadae9c56370439 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 18 Apr 2012 07:16:51 -0700 Subject: [PATCH 2/2] Use "endswith" to detect trailing slash on SITEURL --- pelican/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/settings.py b/pelican/settings.py index c0e30815..7a30e56e 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -130,7 +130,7 @@ def configure_settings(settings, default_settings=None, filename=None): if ('SITEURL' in settings): # If SITEURL has a trailing slash, remove it and provide a warning siteurl = settings['SITEURL'] - if (siteurl[len(siteurl) - 1:] == '/'): + if (siteurl.endswith('/')): settings['SITEURL'] = siteurl[:-1] logger.warn("Removed extraneous trailing slash from SITEURL.") # If SITEURL is defined but FEED_DOMAIN isn't, set FEED_DOMAIN = SITEURL