Skip to content

Commit 3810d4b

Browse files
committed
added feedburner feed
1 parent d4f4fad commit 3810d4b

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

app/controllers/posts_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def index
66

77
respond_to do |format|
88
format.html # index.html.erb
9+
format.atom
910
format.xml { render :xml => @posts }
1011
end
1112
end

app/views/posts/index.atom.builder

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
atom_feed(:url => "http://feeds.feedburner.com/HacketyHack") do |feed|
2+
feed.title("Hackety Hack: blog")
3+
feed.updated(@posts.first ? @posts.first.created_at : Time.now.utc)
4+
5+
for post in @posts
6+
feed.entry(post) do |entry|
7+
entry.title(post.title)
8+
markdown = BlueCloth.new(post.body)
9+
entry.content(markdown.to_html, :type => 'html')
10+
11+
entry.author do |author|
12+
author.name("Steve Klabnik")
13+
author.email("steve@steveklabnik.com")
14+
end
15+
end
16+
end
17+
end
18+

0 commit comments

Comments
 (0)