@@ -26,9 +26,9 @@ module Precious
|
||||
title = crumb.basename
|
||||
|
||||
if title == path.basename
|
||||
breadcrumb << %{<li class="breadcrumb-item" aria-current="page">#{CGI.escape(title.to_s)}</li>}
|
||||
breadcrumb << %{<li class="breadcrumb-item" aria-current="page">#{CGI.escapeHTML(title.to_s)}</li>}
|
||||
else
|
||||
breadcrumb << %{<li class="breadcrumb-item"><a href="#{overview_path}/#{crumb}/">#{CGI.escape(title.to_s)}</a></li>}
|
||||
breadcrumb << %{<li class="breadcrumb-item"><a href="#{overview_path}/#{crumb}/">#{CGI.escapeHTML(title.to_s)}</a></li>}
|
||||
end
|
||||
end
|
||||
breadcrumb << %{</ol></nav>}
|
||||
|
||||
@@ -16,15 +16,10 @@ module Precious
|
||||
DEFAULT_AUTHOR = 'you'
|
||||
@@to_xml = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' }
|
||||
|
||||
def title
|
||||
h1 = @h1_title ? page_header_from_content(@content) : false
|
||||
h1 || @page.url_path_title # url_path_title is the metadata title if present, otherwise the filename-based title
|
||||
end
|
||||
|
||||
def page_header
|
||||
title
|
||||
end
|
||||
|
||||
|
||||
def breadcrumb
|
||||
path = Pathname.new(@page.url_path).parent
|
||||
return '' if path.to_s == '.'
|
||||
@@ -32,7 +27,7 @@ module Precious
|
||||
path.descend do |crumb|
|
||||
element = "#{crumb.basename}"
|
||||
next if element == @page.title
|
||||
breadcrumb << %{<li class="breadcrumb-item"><a href="#{overview_path}/#{crumb}/">#{CGI.escape(element.to_s)}</a></li>}
|
||||
breadcrumb << %{<li class="breadcrumb-item"><a href="#{overview_path}/#{crumb}/">#{CGI.escapeHTML(element.to_s)}</a></li>}
|
||||
end
|
||||
breadcrumb << %{</ol></nav>}
|
||||
breadcrumb.join("\n")
|
||||
@@ -269,6 +264,10 @@ module Precious
|
||||
result << "</tr>\n</table>\n"
|
||||
end
|
||||
|
||||
def title
|
||||
h1 = @h1_title ? page_header_from_content(@content) : false
|
||||
h1 || @page.url_path_title # url_path_title is the metadata title if present, otherwise the filename-based title
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user