2013-02-22 02:20:00 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
|
|
<channel>
|
2013-12-15 17:17:39 +08:00
|
|
|
<% topic_url = Discourse.base_url + @topic_view.relative_url %>
|
|
|
|
<% lang = SiteSetting.find_by_name('default_locale').try(:value) %>
|
2013-12-19 00:06:36 +08:00
|
|
|
<% site_email = SiteSetting.find_by_name('contact_email').try(:value) %>
|
2013-02-22 02:20:00 +08:00
|
|
|
<title><%= @topic_view.title %></title>
|
2013-12-15 17:17:39 +08:00
|
|
|
<link><%= topic_url %></link>
|
2013-02-22 02:20:00 +08:00
|
|
|
<description><%= @topic_view.posts.first.raw %></description>
|
2013-12-19 00:06:36 +08:00
|
|
|
<%= "<language>#{lang}</language>" if lang %>
|
2013-12-15 17:17:39 +08:00
|
|
|
<lastBuildDate><%= @topic_view.topic.created_at.rfc2822 %></lastBuildDate>
|
|
|
|
<category><%= @topic_view.topic.category.name %></category>
|
|
|
|
<atom:link href="<%= topic_url %>.rss" rel="self" type="application/rss+xml" />
|
2013-02-22 02:20:00 +08:00
|
|
|
<% @topic_view.recent_posts.each do |post| %>
|
2013-12-15 17:17:39 +08:00
|
|
|
<% next unless post.user %>
|
|
|
|
<item>
|
2013-12-19 00:06:36 +08:00
|
|
|
<title><%= @topic_view.title %></title>
|
2014-03-19 06:46:48 +08:00
|
|
|
<author><%= "no-reply@example.com (@#{post.user.username}#{" #{post.user.name}" if post.user.name.present?})" -%></author>
|
2013-12-15 17:17:39 +08:00
|
|
|
<description><![CDATA[
|
|
|
|
<% post_url = Discourse.base_url + post.url %>
|
2014-02-12 11:05:13 +08:00
|
|
|
<p><%= t('author_wrote', author: link_to(post.user.name, userpage_url(post.user.username_lower))).html_safe %></p>
|
2013-12-15 17:17:39 +08:00
|
|
|
<blockquote>
|
2013-04-12 04:04:20 +08:00
|
|
|
<%= post.cooked.html_safe %>
|
2013-12-15 17:17:39 +08:00
|
|
|
</blockquote>
|
|
|
|
<p><%= link_to t('read_full_topic'), post_url %></p>
|
|
|
|
]]></description>
|
|
|
|
<link><%= post_url %></link>
|
|
|
|
<pubDate><%= post.created_at.rfc2822 %></pubDate>
|
|
|
|
<guid><%= post_url %></guid>
|
|
|
|
<source url="<%= Discourse.base_url %><%= @topic_view.relative_url %>.rss"><%= @topic_view.title %></source>
|
|
|
|
</item>
|
2013-02-22 02:20:00 +08:00
|
|
|
<% end %>
|
|
|
|
</channel>
|
|
|
|
</rss>
|