Skip to content

Commit 3417b2f

Browse files
fix(nav): show all 5 items on narrow screens (n+6 cap) and scope active state per page (#19)
1 parent 9ac22bc commit 3417b2f

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎_includes/header.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
</a>
77
<nav class="site-nav" aria-label="Primary">
88
<a href="{{ '/docs/00-index/' | relative_url }}"
9-
{% if page.url contains '/docs/' %}aria-current="page"{% endif %}>Contents</a>
10-
<a href="{{ '/docs/10-summary/' | relative_url }}">Summary</a>
9+
{% if page.url == '/docs/00-index/' %}aria-current="page"{% endif %}>Contents</a>
10+
<a href="{{ '/docs/10-summary/' | relative_url }}"
11+
{% if page.url == '/docs/10-summary/' %}aria-current="page"{% endif %}>Summary</a>
1112
<a href="{{ '/demos/' | relative_url }}"
1213
{% if page.url == '/demos/' or page.url == '/setup/' %}aria-current="page"{% endif %}>Demos</a>
1314
<a href="{{ '/bibliography/' | relative_url }}"

‎assets/css/site.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ pre code {
274274
@media (max-width: 720px) {
275275
.site-header__inner { height: 3.5rem; gap: var(--space-3); }
276276
.site-nav { gap: var(--space-3); font-size: .875rem; }
277-
.site-nav a:nth-child(n+5) { display: none; }
277+
.site-nav a:nth-child(n+6) { display: none; }
278278
}
279279

280280
/* ---- 6. Hero ----------------------------------------------- */

0 commit comments

Comments
 (0)