Skip to content

Commit fca23fd

Browse files
ctruedenclaude
andcommitted
Eliminate duplicate same-named menu subentries
Claude made that change in the name of accessibility (see 2274d64), but I have strong negative feelings about menu trees being rendered that way: noooo, we cannot begin a list of H3s with its parent H2! It's just so wrong! So this commit puts it back how it was before, where non-leaf headers can still function as links. To mitigate any possible confusion, hovering over a header-that-is-also-a-link now has an ease-in effect matching the one used for regular links elsewhere. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d2f2299 commit fca23fd

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

_includes/menu/section

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
{%- else -%}
1212
<details>
1313
{%- endif -%}
14-
<summary>{{include.title}}</summary>
15-
<ul>
1614
{%- if include.link -%}
17-
<li><a href="{{include.link}}">{{include.title}}</a></li>
15+
<summary><a href="{{include.link}}">{{include.title}}</a></summary>
16+
{%- else -%}
17+
<summary>{{include.title}}</summary>
1818
{%- endif -%}
19+
<ul>
1920

2021
{%- comment -%}
2122
# vi:syntax=liquid

assets/css/layout.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,15 @@ $sidebarPadding: 10px;
351351
.menu a {
352352
color: var(--color-menu-link);
353353
text-decoration: none;
354+
transition: color 0.2s ease-in;
355+
}
356+
357+
.menu a:hover {
358+
color: var(--color-link-hover);
359+
text-decoration: underline solid;
360+
text-decoration-thickness: 1px;
361+
text-underline-offset: 3px;
362+
border-bottom: none;
354363
}
355364

356365
.menu ul li {
@@ -401,6 +410,8 @@ $sidebarPadding: 10px;
401410

402411
.menu a.current-page:hover {
403412
border-bottom: none;
413+
text-decoration: none;
414+
color: var(--color-menu-current-page);
404415
}
405416

406417
$leftColumnArrowOffset: $sidebarWidth - 2*$sidebarMargin - 2*$sidebarPadding - 30px;

assets/js/jquery.toc.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,12 @@
8181
var parentItem = stack[0].children("li:last")[0];
8282
if (parentItem) {
8383
var aItem = $(parentItem.firstChild); // <a> element
84-
var details = $("<details/>");
84+
var details = $("<details open/>");
8585
var summary = $("<summary/>");
86-
// Use text only (not link) in summary to avoid nesting an interactive
87-
// <a> inside the interactive <summary> (WCAG nested-interactive).
88-
// The link is re-added as the first <li> in the expanded list.
89-
summary.text(aItem.text());
86+
// Put the link directly in the summary so the header is clickable.
87+
summary.append(aItem);
9088
details.append(summary);
9189
var ol = $("<" + listTag + "/>");
92-
// Re-add the section link as first item in the expanded list
93-
$("<li/>").append(aItem).appendTo(ol);
9490
details.append(ol);
9591
details.appendTo(parentItem);
9692
stack.unshift(ol); // move down to the new <ol> level

0 commit comments

Comments
 (0)