Skip to content

fix: restore the index layout broken by the V-001 navigation fix - #29

Merged
AlexMikhalev merged 1 commit into
mainfrom
fix/index-layout-regression
Aug 12, 2026
Merged

fix: restore the index layout broken by the V-001 navigation fix#29
AlexMikhalev merged 1 commit into
mainfrom
fix/index-layout-regression

Conversation

@AlexMikhalev

Copy link
Copy Markdown
Contributor

Reported by the user: the index page became fixed-width with its own scrollbar, breaking the wide-monitor layout.

Cause — mine

.index-container is display: block !important; max-width: 1400px: deliberately a full-width, centred landing page with no sidebar. My V-001 fix dropped the chapter .sidebar into it. grid-area: sidebar means nothing outside a grid, so it rendered as a height: 100vh; overflow-y: auto block inside the capped container — a fixed-width column with a scrollbar.

The problem V-001 identified was real (a README-backed index reached no chapter), but the fix ignored the layout it was editing. No test caught it because every test asserted link presence, never layout.

Fix

The card grid is the landing page's navigation, and the reason the layout is a full-width block. It rendered only when the book had no index page of its own; it now renders in both cases, so README content and the routes into the book appear together.

Card links also get | safe — they are escaped at construction, and Tera was escaping them again into individual/index.html.

Not touched

The multi-column article flow (column-width: 40ch; column-gap: 4rem; column-rule) is byte-identical to the pre-branch stylesheet. That wide-monitor design is intact.

Verified at 1280px

container display block
.sidebar elements 0
horizontal scrollbar none
card links 30
README content present

Full suite green; the test that asserted the wrong fix now asserts the card grid and the absence of a sidebar.

Reported by the user: the index page had become fixed-width with its own
scrollbar, breaking the wide-monitor layout.

Cause was my own V-001 fix. `.index-container` is `display: block
!important; max-width: 1400px` — deliberately a full-width, centred landing
page with no sidebar. I dropped the chapter `.sidebar` into it, and since
`grid-area: sidebar` means nothing outside a grid, it rendered as a
`height: 100vh; overflow-y: auto` block inside the capped container: a
fixed-width column with a scrollbar, exactly as described.

The underlying problem was real — a README-backed index reached no chapter
— but the fix should have used the mechanism the page already has. The card
grid is the landing page's navigation, and it rendered only when the book
had no index page of its own. It now renders in both cases, so the README
content and the routes into the book appear together.

Also marks the card links `| safe`: they are escaped at construction, and
Tera was escaping them again into `individual/index.html`.

The multi-column article flow (`column-width: 40ch`) is untouched and
predates this branch; verified identical to the pre-branch stylesheet.

Verified at 1280px: block layout, no `.sidebar` element, no horizontal
scrollbar, 30 card links, README content intact.
@github-actions

Copy link
Copy Markdown

📊 Performance Benchmark Results

Benchmark Time
pagefind_init/pages/50 2.388 ms
pagefind_init/pages/100 4.518 ms
pagefind_init/pages/500 25.435 ms
Raw Results
{
  "timestamp": "2026-08-12T11:00:18+00:00",
  "benchmarks": [
    {
      "benchmark_name": "pagefind_init/pages/50",
      "mean": {
        "estimate": 2387900
      },
      "unit": "ns"
    },
    {
      "benchmark_name": "pagefind_init/pages/100",
      "mean": {
        "estimate": 4518300
      },
      "unit": "ns"
    },
    {
      "benchmark_name": "pagefind_init/pages/500",
      "mean": {
        "estimate": 25435000
      },
      "unit": "ns"
    }
  ]
}

@github-actions

Copy link
Copy Markdown

🚀 Deployment Preview

Your changes have been deployed to Cloudflare Pages!

🔗 Preview URL: https://preview-29.md-book.pages.dev

The deployment will be updated automatically when you push new changes to this PR.

@AlexMikhalev
AlexMikhalev merged commit fdc4625 into main Aug 12, 2026
23 checks passed
@AlexMikhalev
AlexMikhalev deleted the fix/index-layout-regression branch August 12, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant