fix absolute links in merged RSS feed

master
muflax 2012-11-16 11:19:24 +01:00
parent 9d87473669
commit 803e44a32b
1 changed files with 4 additions and 0 deletions

View File

@ -71,6 +71,10 @@ def rss_feed_merged
@site.site_yaml["sites"].keys.each do |name|
feed = RSS::Parser.parse(File.open("out/#{name}/rss.xml"))
date = [feed.channel.date, date].max
feed.items.each do |item|
# fix absolute links to other sites
item.description.gsub! /(?<tag> (src|href) = ["'] ) (?<url> \/ \w+)/x, "\\k<tag>#{site_url(name)}\\k<url>"
end
items.concat feed.items
end