Skip to content

fix: correct invalid grid nesting, heading nesting, and navbar collapse - #183

Merged
magnus-madsen merged 1 commit into
masterfrom
fix/markup-issues
Aug 3, 2026
Merged

fix: correct invalid grid nesting, heading nesting, and navbar collapse#183
magnus-madsen merged 1 commit into
masterfrom
fix/markup-issues

Conversation

@magnus-madsen

Copy link
Copy Markdown
Member

Three markup issues found while auditing the site.

.row nested directly inside .rowsrc/pages/index.astro

The Sponsors and Collaborators sections put the heading and the logo grid as siblings inside a single .row, so the inner .row's -15px negative margins applied with no .col padding to cancel them. Split each into two sibling rows, moving mb-4 to the logo row so the spacing before the following <hr> is unchanged.

Verified in the build output: <div> open/close counts balance (216/216) and there are no remaining row-in-row occurrences.

Heading wrapped in an anchor — src/pages/blog.astro

<a><h2>…</h2></a><h2><a href="…">…</a></h2>. Renders identically; the <a> still supplies the link color the <h2> was inheriting.

Navbar with no collapse or toggler — src/layouts/Layout.astro

The <ul> was not inside a .collapse.navbar-collapse and there was no toggler, so navbar-expand-md just stacked nine links vertically on mobile with no hamburger.

This one needed more than markup. Bootstrap's .collapse:not(.show){display:none} would have hidden the nav outright below 768px, and Bootstrap 4's collapse JS requires jQuery, which this site doesn't load. So the toggler ships a small script that toggles .show and keeps aria-expanded in sync — the same no-jQuery approach the Carousel component already uses. The button gets aria-label and aria-controls since it's a new control.

Checked against the compiled Bootstrap CSS that both .navbar-expand-md .navbar-collapse{display:flex!important} and .navbar-expand-md .navbar-toggler{display:none} sit inside @media (min-width:768px), so the desktop nav is untouched and a leftover .show is harmless when resizing back up. .navbar-dark .navbar-toggler-icon supplies a white hamburger, so the button is visible on the bg-info bar.

Behavior change

Below 768px the nine nav links previously stacked vertically and were always visible; they are now behind the hamburger. That's the point of the fix, but it is the only user-visible change in this PR — worth a look on a phone before merging.

Testing

  • astro check — 0 errors, 0 warnings, 0 hints
  • astro build — 10 pages built
  • Structural verification of the emitted HTML as described above

No accessibility, SEO, performance, or security items from the wider audit are touched here.

🤖 Generated with Claude Code

Three markup issues found while auditing the site:

- index.astro nested a `.row` directly inside another `.row` in the
  Sponsors and Collaborators sections. The inner row's -15px negative
  margins applied with no `.col` padding to cancel them. Split each into
  two sibling rows, moving `mb-4` to the logo row so spacing before the
  following `<hr>` is unchanged.

- blog.astro wrapped an `<h2>` in an `<a>`. Inverted to put the anchor
  inside the heading. The `<a>` still supplies the link color the `<h2>`
  was inheriting, so it renders identically.

- The navbar `<ul>` was not inside a `.collapse.navbar-collapse` and had
  no toggler, so `navbar-expand-md` just stacked nine links vertically on
  mobile. Added the collapse wrapper and a `.navbar-toggler`.

Bootstrap's collapse JS needs jQuery, which the site does not load, and
`.collapse:not(.show)` would otherwise hide the nav outright below the md
breakpoint. So the toggler ships a small script that toggles `.show` and
keeps `aria-expanded` in sync, following the same no-jQuery approach the
Carousel component already uses.

Above md, `.navbar-collapse` is `display: flex !important` and the
toggler is `display: none`, so the desktop nav is untouched and a stale
`.show` is harmless when resizing back up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit e287445 into master Aug 3, 2026
2 checks passed
@magnus-madsen
magnus-madsen deleted the fix/markup-issues branch August 3, 2026 13: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