FIX: rss feed should be valid

This commit is contained in:
Arpit Jalan 2015-05-11 10:50:24 +05:30
parent 2282869f30
commit 7a20ed0617
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@
<lastBuildDate><%= @topic_list.topics.first.created_at.rfc2822 %></lastBuildDate>
<atom:link href="<%= @atom_link %>" rel="self" type="application/rss+xml" />
<% @topic_list.topics.each do |topic| %>
<% topic_url = topic.relative_url -%>
<% topic_url = topic.url -%>
<item>
<title><%= topic.title %></title>
<author><%= "no-reply@example.com (@#{topic.user.username}#{" #{topic.user.name}" if (topic.user.name.present? && SiteSetting.enable_names?)})" -%></author>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<% topic_url = @topic_view.relative_url %>
<% topic_url = @topic_view.absolute_url %>
<% lang = SiteSetting.find_by_name('default_locale').try(:value) %>
<% site_email = SiteSetting.find_by_name('contact_email').try(:value) %>
<title><%= @topic_view.title %></title>
@ -31,7 +31,7 @@
<link><%= post_url %></link>
<pubDate><%= post.created_at.rfc2822 %></pubDate>
<guid isPermaLink="false">post-<%= post.topic_id %>-<%= post.post_number %></guid>
<source url="<%= @topic_view.relative_url %>.rss"><%= @topic_view.title %></source>
<source url="<%= @topic_view.absolute_url %>.rss"><%= @topic_view.title %></source>
</item>
<% end %>
</channel>