Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 305523dd0b660080b14e4933d9ea4afab590acd5 1 parent a40d954
@myabc myabc authored
View
10 app/helpers/global_helpers.rb
@@ -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
View
2  app/views/feather/articles/_article.html.erb
@@ -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.
Something went wrong with that request. Please try again.