Skip to content

Commit

Permalink
Added RSS feed
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Heidel authored and parndt committed Feb 4, 2010
1 parent ca91aab commit ef96a6f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions vendor/plugins/news/app/views/news_items/index.rss.builder
@@ -0,0 +1,25 @@
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0", "xmlns:atom" => "http://www.w3.org/2005/Atom" do
xml.channel do
# Required to pass W3C validation.
xml.atom :link, nil, {
:href => news_items_url(:format => 'rss'),
:rel => 'self', :type => 'application/rss+xml'
}

# Feed basics.
xml.title page_title
xml.description @page[:body].gsub(/<\/?[^>]*>/, "")
xml.link news_items_url(:format => 'rss')

# News items.
@news_items.each do |news_item|
xml.item do
xml.title news_item.title
xml.link news_item_url(news_item)
xml.pubDate news_item.publish_date.to_s(:rfc822)
xml.guid news_item_url(news_item)
end
end
end
end
1 change: 1 addition & 0 deletions vendor/plugins/refinery/app/views/shared/_head.html.erb
Expand Up @@ -5,6 +5,7 @@
<%= stylesheet_link_tag "#{'theme/' if theme}application", "#{'theme/' if theme}formatting", "theme" %>
<%= stylesheet_link_tag "#{'theme/' if theme}home" if home_page? %>
<%= "<!--[if IE 7]>#{stylesheet_link_tag 'ie7'}<![endif]-->" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
<%= auto_discovery_link_tag(:rss, news_items_url(:format => 'rss')) %>
<link rel="shortcut icon" href="/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%= "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\" />" if @meta.meta_keywords.present? %>
Expand Down

0 comments on commit ef96a6f

Please sign in to comment.