The documentation for Plume.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
1.0 KiB

<% if items.size > 0 %>
<ul>
<% items.each do |i| %>
<li title="<%= i.data.summary || '' %>">
<% children = resources
.select{ |r|
r.url.split("/").size == i.url.split("/").size + 1 &&
r.url.start_with?(i.url)
}
.sort{ |a, b| a.data.title <=> b.data.title }
.sort{ |a, b| -(a.data.priority || 0) <=> -(b.data.priority || 0) }
%>
<% if children.size == 0 %>
<%= link_to i.data.title, i %>
<% else %>
<details>
<summary><%= link_to i.data.title, i %><i data-feather="chevron-left"></i></summary>
<%= partial :nav_item, :locals => {
:items => children,
:resources => resources
} %>
</details>
<% end %>
</li>
<% end %>
</ul>
<% end %>