diff --git a/partials/_accordion_nav.html.erb b/partials/_accordion_nav.html.erb
index 8e405cb38e..d0128c4298 100644
--- a/partials/_accordion_nav.html.erb
+++ b/partials/_accordion_nav.html.erb
@@ -1,13 +1,29 @@
-<%
+<%
def section_open?(section)
(!section[:path].nil? && current_page?(section[:path])) ||
(!section[:open].nil? && section[:open]) ||
(section[:links] && section[:links].any? { |page| (!page[:path].nil? && current_page?(page[:path])) || (page[:links] && section_open?(page)) })
end
+ # Ties a trigger to the panel it controls via aria-controls.
+ def accordion_id(section, prefix)
+ slug = section[:title].to_s.downcase.gsub(/[^a-z0-9]+/, "-").gsub(/\A-+|-+\z/, "")
+ "#{prefix}-#{slug.empty? ? "section" : slug}"
+ end
+
+ # The section's own index page moves into the list as "Overview" so the header
+ # row has exactly one job instead of being half link, half toggle. Skipped
+ # when the links already include that page, which most sections do.
+ def overview_needed?(section)
+ return false if section[:path].nil?
+ target = section[:path].to_s.chomp("/")
+ !Array(section[:links]).any? { |page| page[:path].to_s.chomp("/") == target }
+ end
+
nav.each { |nav| nav[:open] = section_open?(nav) unless nav[:title].nil? }
- nav.each do |nav|
+ nav.each_with_index do |nav, nav_index|
+ section_id = accordion_id(nav, "nav-#{nav_index}")
%>
<% if nav[:links].nil? %>
<%= nav_link nav[:title], nav[:path], class: "title-link" %>
@@ -29,36 +45,42 @@
<% else %>
">
- <% if nav[:title] && nav[:path] %>
+ <%# One control per row: the whole header toggles. Previously the title
+ navigated and only the remainder of the row toggled, with no visible
+ seam between the two. %>
+ <% if nav[:links] && nav[:links].size > 0 %>
+
+ <% elsif nav[:title] && nav[:path] %>
<%= nav_link nav[:title], nav[:path], class: "title-link" %>
<% else %>
<%= nav[:title] %>
<% end %>
- <%# Only show the accordion trigger if there are real subpages %>
- <% if nav[:links] && nav[:links].size > 0 %>
-
- <% end %>
-
-
- <% nav[:links]&.each do |page| %>
+ <%# inert keeps collapsed links out of the tab order and the accessibility
+ tree. Clipping them with grid-rows/opacity alone left every link in
+ every closed section focusable and announced. %>
+
<% if subpage[:type] == "flyctl" %>
@@ -93,4 +115,4 @@
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
diff --git a/partials/_breadcrumbs.html.erb b/partials/_breadcrumbs.html.erb
index 31a280e93a..a02257f307 100644
--- a/partials/_breadcrumbs.html.erb
+++ b/partials/_breadcrumbs.html.erb
@@ -1,25 +1,55 @@
-
+ <%= parent_title %>
+
+
+<% else %>
+
+<% end %>