Permalink
Browse files

Fix article links when using Feather as a slice with path prefix

Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
  • Loading branch information...
1 parent a40d954 commit 305523dd0b660080b14e4933d9ea4afab590acd5 @myabc myabc committed Mar 13, 2009
Showing with 10 additions and 2 deletions.
  1. +9 −1 app/helpers/global_helpers.rb
  2. +1 −1 app/views/feather/articles/_article.html.erb
@@ -184,7 +184,15 @@ def is_plugin_active(name)
plugin = ::Feather::Plugin.get(name)
plugin && plugin.active
end
-
+
+ def link_to_article(text, article)
+ if is_slice? && !::Feather.config[:path_prefix].empty?
+ link_to(text, '/' + ::Feather.config[:path_prefix] + article.permalink)
+ else
+ link_to(text, article.permalink)
+ end
+ end
+
def link_to_author(author)
link_to author["name"], author["homepage"]
end
@@ -1,7 +1,7 @@
<%= render_plugin_views @articles.nil? ? "before_article" : "before_article_in_list", :with => article %>
<div class="hentry" id="article-<%= article.id %>">
<h2 class="entry-title">
- <%= link_to(article.title, article.permalink) %>
+ <%= link_to_article(article.title, article) %>
</h2>
<div class="vcard">
Posted by <span class="fn"><%= article.user_name %></span>

0 comments on commit 305523d

Please sign in to comment.