Remove prefix. #470.

This commit is contained in:
bootstraponline
2012-08-16 12:01:03 -06:00
parent 6cfc807db0
commit e73c84490e
2 changed files with 6 additions and 10 deletions
+4 -8
View File
@@ -5,10 +5,6 @@ module Precious
class Pages < Layout
attr_reader :results, :ref
def prefix
@base_url ? @base_url.chomp('/') + '/' : '/'
end
def title
"All pages in #{@ref}"
end
@@ -16,14 +12,14 @@ module Precious
def breadcrumb
if @path
path = Pathname.new(@path)
breadcrumb = [%{<a href="#{prefix}pages/">Home</a>}]
breadcrumb = [%{<a href="#{@base_url}/pages/">Home</a>}]
path.descend do |crumb|
title = crumb.basename
if title == path.basename
breadcrumb << title
else
breadcrumb << %{<a href="#{prefix}pages/#{crumb}/">#{title}</a>}
breadcrumb << %{<a href="#{@base_url}/pages/#{crumb}/">#{title}</a>}
end
end
@@ -43,7 +39,7 @@ module Precious
if page_path.include?('/')
folder = page_path.split('/').first
folder_path = @path ? "#{@path}/#{folder}" : folder
folder_link = %{<li><a href="#{prefix}pages/#{folder_path}/" class="folder">#{folder}</a></li>}
folder_link = %{<li><a href="#{@base_url}/pages/#{folder_path}/" class="folder">#{folder}</a></li>}
unless folder_links.include?(folder_link)
folder_links << folder_link
@@ -51,7 +47,7 @@ module Precious
folder_link
end
elsif page_path != ".gitkeep"
%{<li><a href="#{prefix}#{page.escaped_url_path}" class="file">#{page.name}</a></li>}
%{<li><a href="#{@base_url}/#{page.escaped_url_path}" class="file">#{page.name}</a></li>}
end
}.compact.join("\n")
else