Fix the styling of the sidebar on the blueprint layout.
This commit is contained in:
parent
19bf4455f1
commit
29a9204cf7
@ -1,3 +1,5 @@
|
|||||||
- render 'main' do
|
- render 'main' do
|
||||||
%aside(role="sidebar")= render 'partials/sidebar', :default_stylesheet => "_blueprint.scss", :omit_self => false, :heading_level => 2
|
%aside(role="sidebar")
|
||||||
|
%nav#local-nav
|
||||||
|
%ul=item_tree(reference_item(:stylesheet => "_blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2)
|
||||||
%article= yield
|
%article= yield
|
@ -68,15 +68,13 @@ def item_tree(item, options = {})
|
|||||||
options[:heading_level] ||= 1 if options.fetch(:headings, true)
|
options[:heading_level] ||= 1 if options.fetch(:headings, true)
|
||||||
child_html = ""
|
child_html = ""
|
||||||
if options.fetch(:depth,1) > 0
|
if options.fetch(:depth,1) > 0
|
||||||
if item.children.any?
|
child_opts = options.dup
|
||||||
item.children.sort_by{|c| c[:crumb] || c[:title]}.each do |child|
|
child_opts[:depth] -= 1 if child_opts.has_key?(:depth)
|
||||||
child_opts = options.dup
|
child_opts[:heading_level] += 1 if child_opts[:heading_level]
|
||||||
child_opts[:depth] -= 1 if child_opts.has_key?(:depth)
|
child_opts.delete(:omit_self)
|
||||||
child_opts[:heading_level] += 1 if child_opts[:heading_level]
|
item.children.sort_by{|c| c[:crumb] || c[:title]}.each do |child|
|
||||||
child_opts.delete(:omit_self)
|
child_html << item_tree(child, child_opts)
|
||||||
child_html << item_tree(child, child_opts)
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
options.delete(:heading_level)
|
options.delete(:heading_level)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user