Skip to content

Commit c6b4fbb

Browse files
committed
Display breadcrumb only nested two or more levels
1 parent b9124e2 commit c6b4fbb

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/rdoc/generator/template/darkfish/class.rhtml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@
1818
</nav>
1919

2020
<main role="main" aria-labelledby="<%=h klass.aref %>">
21-
<ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
22-
<% breadcrumb.each do |namespace| %>
23-
<li>
24-
<% if namespace[:self] %>
25-
<span><%= namespace[:name] %></span>
26-
<% else %>
27-
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
21+
<%# If nesting level is 1, breadcrumb list is not needed %>
22+
<% if breadcrumb.size > 1 %>
23+
<ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
24+
<% breadcrumb.each do |namespace| %>
25+
<li>
26+
<% if namespace[:self] %>
27+
<span><%= namespace[:name] %></span>
28+
<% else %>
29+
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
30+
<% end %>
31+
</li>
2832
<% end %>
29-
</li>
30-
<% end %>
31-
</ol>
33+
</ol>
34+
<% end %>
3235

3336
<h1 id="<%=h klass.aref %>" class="anchor-link <%= klass.type %>">
3437
<%= klass.type %> <%= klass.full_name %>

0 commit comments

Comments
 (0)