Commit ccc3d974 authored by Tobias Schmidt's avatar Tobias Schmidt

Rename navigation helper function to nav()

parent ba144dbb
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="col-md-3 side-nav-col"> <div class="col-md-3 side-nav-col">
<ul class="nav navbar-nav side-nav"> <ul class="nav navbar-nav side-nav">
<% @items['/docs/'].children.sort_by { |i| i[:sort_rank] || 0 }.each do |i| %> <% @items['/docs/'].children.sort_by { |i| i[:sort_rank] || 0 }.each do |i| %>
<%= toc(i, @item) %> <%= nav(i, @item) %>
<% end %> <% end %>
</ul> </ul>
</div> </div>
......
...@@ -2,7 +2,7 @@ def nav_title_of(i) ...@@ -2,7 +2,7 @@ def nav_title_of(i)
i[:nav_title] || i[:title] || '' i[:nav_title] || i[:title] || ''
end end
def toc(root_item, focused_item, buffer='', layer=0) def nav(root_item, focused_item, buffer='', layer=0)
# Skip non-written or hidden items # Skip non-written or hidden items
return buffer if root_item.nil? || root_item.path.nil? || root_item[:is_hidden] return buffer if root_item.nil? || root_item.path.nil? || root_item[:is_hidden]
...@@ -30,7 +30,7 @@ def toc(root_item, focused_item, buffer='', layer=0) ...@@ -30,7 +30,7 @@ def toc(root_item, focused_item, buffer='', layer=0)
buffer << '<ul class="nav">' buffer << '<ul class="nav">'
visible_children.each do |child| visible_children.each do |child|
toc(child, focused_item, buffer, layer + 1) nav(child, focused_item, buffer, layer + 1)
end end
buffer << '</ul>' buffer << '</ul>'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment