Skip to content
Browse files

Only show feed links if a sensible link is available

Fixes #92.
  • Loading branch information...
1 parent 095dddb commit 0dd82ad3b806b2c7c914e91c977fcf44389b1a57 @mvz mvz committed
View
3 app/controllers/authors_controller.rb
@@ -9,12 +9,13 @@ def show
@keywords = (this_blog.meta_keywords.empty?) ? "" : this_blog.meta_keywords
@description = this_blog.author_desc_template.to_title(@author, this_blog, params)
+ auto_discovery_feed(:only_path => false)
+
respond_to do |format|
format.html do
render
end
format.rss do
- auto_discovery_feed(:only_path => false)
render_feed "rss"
end
format.atom do
View
5 app/helpers/application_helper.rb
@@ -178,9 +178,6 @@ def feed_atom
@article.feed_url(:atom)
elsif not @auto_discovery_url_atom.nil?
@auto_discovery_url_atom
- else
- # FIXME: When is this invoked?
- url_for(:only_path => false, :format => 'atom')
end
end
@@ -191,8 +188,6 @@ def feed_rss
@article.feed_url(:rss20)
elsif not @auto_discovery_url_rss.nil?
@auto_discovery_url_rss
- else
- url_for(:only_path => false, :format => 'rss')
end
end
View
8 app/views/shared/_page_header.html.erb
@@ -6,8 +6,12 @@
<meta name="generator" content="Typo <%=TYPO_VERSION%>" />
<%= show_meta_keyword %>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="<%= url_for :controller => '/xml', :action => 'rsd' %>" />
-<link rel="alternate" type="application/atom+xml" title="Atom" href="<%= feed_atom %>" />
-<link rel="alternate" type="application/rss+xml" title="RSS" href="<%= feed_rss %>" />
+<%- if feed_atom %>
+ <link rel="alternate" type="application/atom+xml" title="Atom" href="<%= feed_atom %>" />
+<%- end %>
+<%- if feed_rss %>
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= feed_rss %>" />
+<%- end %>
<%= javascript_include_tag 'cookies', 'prototype', 'effects', 'builder', 'typo', :cache => true %>
<%= stylesheet_link_tag 'coderay', 'user-styles', :cache => true %>
<%= javascript_include_lang %>

0 comments on commit 0dd82ad

Please sign in to comment.
Something went wrong with that request. Please try again.