mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 03:17:53 -05:00
35 lines
1.5 KiB
Text
35 lines
1.5 KiB
Text
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
<channel>
|
|
<% lang = SiteSetting.find_by_name('default_locale').try(:value) %>
|
|
<title><%= @title %></title>
|
|
<link><%= @link %></link>
|
|
<description><%= @description %></description>
|
|
<% if lang %>
|
|
<language><%= lang %></language>
|
|
<% end %>
|
|
<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 = Discourse.base_url + topic.relative_url -%>
|
|
<item>
|
|
<title><%= topic.title %></title>
|
|
<author><%= "@#{topic.user.username} (#{topic.user.name})" -%></author>
|
|
<category><%= topic.category.name %></category>
|
|
<description><![CDATA[
|
|
<p><%= t('author_wrote', author: link_to(topic.user.name, topic.user)).html_safe %></p>
|
|
<blockquote>
|
|
<%= topic.posts.first.cooked.html_safe %>
|
|
</blockquote>
|
|
<p><%= t 'num_posts' %> <%= topic.posts_count %></p>
|
|
<p><%= t 'num_participants' %> <%= topic.participant_count %></p>
|
|
<p><%= link_to t('read_full_topic'), topic_url %></p>
|
|
]]></description>
|
|
<link><%= topic_url %></link>
|
|
<pubDate><%= topic.created_at.rfc2822 %></pubDate>
|
|
<guid><%= topic_url %></guid>
|
|
<source url="<%= topic_url %>.rss"><%= topic.title %></source>
|
|
</item>
|
|
<% end %>
|
|
</channel>
|
|
</rss>
|