journalduhacker/app/views/home/rss.erb
joshua stein 342d6ff911 move markeddown html into sql so it doesn't have to be generated every time
it's unlikely to change and if it does, we can just re-generate
everything in sql at once
2012-08-24 11:41:35 -05:00

28 lines
1 KiB
Plaintext

<?xml version="1.0" encoding="UTF-8" ?>
<% coder = HTMLEntities.new %>
<rss version="2.0">
<channel>
<title>lobste.rs<%= @page_title ? ": " + h(@page_title) : "" %></title>
<description><%= @page_title %></description>
<link><%= root_url + (@newest ? "newest" : "") %></link>
<% @stories.each do |story| %>
<item>
<title><%= raw coder.encode(story.title, :decimal) %></title>
<link><%= story.url_or_comments_url %></link>
<guid><%= story.short_id_url %></guid>
<author><%= story.user.username %></author>
<pubDate><%= story.created_at.rfc2822 %></pubDate>
<comments><%= story.comments_url %></comments>
<% if story.markeddown_description.present? %>
<description><%= raw coder.encode(story.markeddown_description,
:decimal) %></description>
<% end %>
<% story.taggings.each do |tagging| %>
<category><%= tagging.tag.tag %></category>
<% end %>
</item>
<% end %>
</channel>
</rss>