Skip to content

Commit

Permalink
Fix #264
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Sep 2, 2013
1 parent b3c329c commit 13aff99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 3 additions & 4 deletions nikola/plugins/task/rss.py
Expand Up @@ -26,15 +26,14 @@

from __future__ import unicode_literals, print_function
import os

from nikola import utils
from nikola.plugin_categories import Task

try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin # NOQA

from nikola import utils
from nikola.plugin_categories import Task


class RenderRSS(Task):
"""Generate RSS feeds."""
Expand Down
12 changes: 9 additions & 3 deletions nikola/plugins/task/tags.py
Expand Up @@ -28,6 +28,10 @@
import codecs
import json
import os
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin # NOQA

from nikola.plugin_categories import Task
from nikola import utils
Expand Down Expand Up @@ -255,8 +259,10 @@ def tag_rss(self, tag, lang, posts, kw, is_category):
"""RSS for a single tag / language"""
kind = "category" if is_category else "tag"
#Render RSS
output_name = os.path.join(kw['output_folder'],
self.site.path(kind + "_rss", tag, lang))
output_name = os.path.normpath(
os.path.join(kw['output_folder'],
self.site.path(kind + "_rss", tag, lang)))
feed_url = urljoin(self.site.config['BASE_URL'], self.site.link(kind + "_rss", tag, lang).lstrip('/'))
deps = []
post_list = [self.site.global_data[post] for post in posts if
self.site.global_data[post].use_in_feeds]
Expand All @@ -272,7 +278,7 @@ def tag_rss(self, tag, lang, posts, kw, is_category):
'actions': [(utils.generic_rss_renderer,
(lang, "{0} ({1})".format(kw["blog_title"], tag),
kw["site_url"], kw["blog_description"], post_list,
output_name, kw["rss_teasers"], kw['feed_length']))],
output_name, kw["rss_teasers"], kw['feed_length'], feed_url))],
'clean': True,
'uptodate': [utils.config_changed(kw)],
'task_dep': ['render_posts'],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Expand Up @@ -188,7 +188,7 @@ def patch_site(self):
conf_path = os.path.join(self.target_dir, "conf.py")
with codecs.open(conf_path, "rb", "utf-8") as inf:
data = inf.read()
data = data.replace('SITE_URL = "http://nikola.ralsina.com.ar"',
data = data.replace('SITE_URL = "http://nikola.ralsina.com.ar/"',
'SITE_URL = "http://nikola.ralsina.com.ar/foo/bar/"')
with codecs.open(conf_path, "wb+", "utf8") as outf:
outf.write(data)
Expand Down

0 comments on commit 13aff99

Please sign in to comment.