-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrss.xml.erb
More file actions
19 lines (19 loc) · 781 Bytes
/
rss.xml.erb
File metadata and controls
19 lines (19 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><%= h blog.title %></title>
<description></description>
<link><%= blog.url %></link>
<lastBuildDate><%= Time.new.strftime("%a, %d %b %Y %H:%M:%S %z") %></lastBuildDate>
<atom:link href="<%= blog.url %>rss.xml" rel="self" type="application/rss+xml" />
<% blog.public_posts.each do |post| %>
<item>
<title><%= h post.name %></title>
<pubDate><%= post.date.strftime("%a, %d %b %Y %H:%M:%S %z") %></pubDate>
<description><%= h post.html %></description>
<link><%= "#{blog.url}#{u post.url}" %></link>
<guid><%= "#{blog.url}#{u post.url}" %></guid>
</item>
<% end %>
</channel>
</rss>