iamdoubz-update-from-src-patch/source/_nav_item.erb
KitaitiMakoto 9460231982 Fix #77 Add language switcher (again) (#113)
Update README

Fix a typo

Prepend bundle exec to middleman command

Use link_to_lang helper

Use relative path for links

Append solidus to links to directory index

Update Bundler

Install Webrick

Add Webrick to dependencies

Remove Crowdin related code from template

Co-authored-by: Kitaiti Makoto <KitaitiMakoto@gmail.com>
Reviewed-on: plume/documentation#113
2020-12-27 15:51:03 +00:00

27 lines
1 KiB
Text

<% 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 %>