diff --git a/docs/plans/mdbook-parity-validation-report.md b/docs/plans/mdbook-parity-validation-report.md index 98d6cd9..cfd48d2 100644 --- a/docs/plans/mdbook-parity-validation-report.md +++ b/docs/plans/mdbook-parity-validation-report.md @@ -57,7 +57,8 @@ fixed. Measuring also removed one avoidable cost (a duplicate mdast parse per pa | ID | Description | Origin | Severity | Resolution | |----|-------------|--------|----------|------------| -| V-001 | Index page had no navigation: one link (the logo) versus 30 on a chapter page. A README-backed index skips the card grid, and the template never included the sidebar | **Phase 2 (design omission)** | High | `3704b0d` | +| V-001 | Index page had no navigation: one link (the logo) versus 30 on a chapter page. A README-backed index skips the card grid | **Phase 2 (design omission)** | High | `3704b0d`, corrected in `fix/index-layout-regression` | +| V-005 | The V-001 fix injected the chapter `.sidebar` into `.index-container`, which is `display: block !important; max-width: 1400px`. With `grid-area` meaningless outside a grid, the sidebar became a `height: 100vh; overflow-y: auto` block inside the capped-width landing page — a fixed-width column with its own scrollbar. Reported by the user, not by any test | **Phase 3 (my fix ignored the target layout)** | High | Card grid now renders alongside index content; no sidebar on the landing page | | V-002 | Sidebar's deprecated branch read `page.sections`, absent from the index context — an empty book failed to render | Phase 2 (context asymmetry) | Medium | `3704b0d` | | V-003 | Logo link had no accessible name (`alt=""` on the image left the anchor unnamed) | Phase 3 | **Serious (WCAG 2.4.4, 4.1.2)** | `8bcc6b7` | | V-004 | On-this-page component emitted bare `div`s, leaving content outside any landmark | Phase 2 (component markup unspecified) | Moderate | `8bcc6b7` | diff --git a/src/templates/index.html.tera b/src/templates/index.html.tera index a6ad6e4..8040766 100644 --- a/src/templates/index.html.tera +++ b/src/templates/index.html.tera @@ -35,22 +35,23 @@
{% include "header.html" %} - {# The landing page needs the same navigation as any chapter: with a - README-backed index the card grid is skipped, which used to leave the - page with no way to reach the book at all. #} -
{% if has_index %}
{{ content | safe }}
- {% else %} + {% endif %} + {% if not has_index %}

Documentation

-
+ {% endif %} + {# The card grid is this page's navigation, and the reason the + layout is a full-width block rather than the chapter grid. It + used to render only when there was no index page of its own, + which left a README-backed book with no route into its + chapters at all. #} +
{% for section in sections %}

{{ section.title }}

@@ -58,7 +59,7 @@ {% for page in section.pages %}

{{ page.title }}

- + Read More @@ -67,8 +68,7 @@
{% endfor %} -
- {% endif %} +
@@ -79,4 +79,4 @@ - \ No newline at end of file + diff --git a/tests/integration/build_test.rs b/tests/integration/build_test.rs index 11c3752..d50c8fd 100644 --- a/tests/integration/build_test.rs +++ b/tests/integration/build_test.rs @@ -1323,7 +1323,11 @@ async fn test_index_page_is_navigable() -> Result<()> { let index = book.read_output("index.html")?; assert_contains!(index, "one.html"); assert_contains!(index, "sub/two.html"); - assert_contains!(index, "sidebar-nav"); + // Navigation here is the card grid, not the chapter sidebar: the landing + // page is a full-width block layout by design, and dropping a grid-area + // sidebar into it produced a fixed-width column with its own scrollbar. + assert_contains!(index, "card-grid"); + assert_not_contains!(index, "class=\"sidebar\""); Ok(()) }