|
1 | 1 | <%- simple_files = @files.select { |f| f.text? } %> |
| 2 | + |
2 | 3 | <%- if defined?(current) && current.respond_to?(:page_name) %> |
3 | 4 | <%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %> |
4 | 5 | <%- end %> |
| 6 | + |
5 | 7 | <%- unless simple_files.empty? then %> |
6 | 8 | <div id="fileindex-section" class="nav-section"> |
7 | 9 | <details class="nav-section-collapsible" open> |
8 | 10 | <summary class="nav-section-header"> |
9 | 11 | <span class="nav-section-icon"> |
10 | | - <svg><use href="#icon-file"></use></svg> |
| 12 | + <svg> |
| 13 | + <use href="#icon-file"></use> |
| 14 | + </svg> |
11 | 15 | </span> |
| 16 | + |
12 | 17 | <span class="nav-section-title">Pages</span> |
| 18 | + |
13 | 19 | <span class="nav-section-chevron"> |
14 | | - <svg><use href="#icon-chevron"></use></svg> |
| 20 | + <svg> |
| 21 | + <use href="#icon-chevron"></use> |
| 22 | + </svg> |
15 | 23 | </span> |
16 | 24 | </summary> |
17 | 25 |
|
18 | 26 | <ul class="nav-list"> |
19 | | - <%- grouped_files = simple_files.group_by { |f| f.full_name[%r{\A[^/]+(?=/)}] || f.page_name } %> |
20 | | - <%- grouped_files.each do |n, files| %> |
21 | | - <%- f = files.shift %> |
22 | | - <%- if files.empty? %> |
23 | | - <li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a></li> |
24 | | - <%- next %> |
| 27 | + <%- grouped_files = simple_files.group_by { |f| f.full_name[%r{\A[^/]+(?=/)}] || f.page_name } %> |
| 28 | + |
| 29 | + <%- grouped_files.each do |n, files| %> |
| 30 | + <%- f = files.shift %> |
| 31 | + |
| 32 | + <%- if files.empty? %> |
| 33 | + <li> |
| 34 | + <a href="<%= rel_prefix %>/<%= h f.path %>"> |
| 35 | + <%= h f.page_name %> |
| 36 | + </a> |
| 37 | + </li> |
| 38 | + <%- next %> |
| 39 | + <%- end %> |
| 40 | + |
| 41 | + <li> |
| 42 | + <details <%= dir == n ? ' open' : '' %>> |
| 43 | + <summary> |
| 44 | + <% if n == f.page_name %> |
| 45 | + <a href="<%= rel_prefix %>/<%= h f.path %>"><%= h n %></a> |
| 46 | + <% else %> |
| 47 | + <%= h n %> |
| 48 | + <% files.unshift(f) %> |
| 49 | + <% end %> |
| 50 | + </summary> |
| 51 | + |
| 52 | + <ul class="link-list"> |
| 53 | + <%- files.each do |f| %> |
| 54 | + <li> |
| 55 | + <a href="<%= rel_prefix %>/<%= h f.path %>"> |
| 56 | + <%= h f.page_name %> |
| 57 | + </a> |
| 58 | + </li> |
| 59 | + <%- end %> |
| 60 | + </ul> |
| 61 | + </details> |
| 62 | + </li> |
25 | 63 | <%- end %> |
26 | | - <li> |
27 | | - <details class="nav-subsection" <%= dir == n ? ' open' : '' %>> |
28 | | - <summary> |
29 | | - <% if n == f.page_name %> |
30 | | - <a href="<%= rel_prefix %>/<%= h f.path %>"><%= h n %></a> |
31 | | - <% else %> |
32 | | - <%= h n %> |
33 | | - <% files.unshift(f) %> |
34 | | - <% end %> |
35 | | - </summary> |
36 | | - <ul class="link-list"> |
37 | | - <%- files.each do |f| %> |
38 | | - <li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a></li> |
39 | | - <%- end %> |
40 | | - </ul> |
41 | | - </details> |
42 | | - </li> |
43 | | - <%- end %> |
44 | 64 | </ul> |
45 | 65 | </details> |
46 | 66 | </div> |
|
0 commit comments