From 3bc9f8ce363867530f940bbc114b521f9d00c019 Mon Sep 17 00:00:00 2001 From: interlope Date: Fri, 29 May 2026 18:07:23 +0200 Subject: [PATCH] Align navbar container with wider article layout for improved consistency --- css/style.css | 6 ++++++ index.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/css/style.css b/css/style.css index 1aefdb7..3a9f681 100644 --- a/css/style.css +++ b/css/style.css @@ -252,6 +252,12 @@ body > .container-wide { max-width: 1400px; } +/* Align the navbar's inner container with the wider article layout so the + brand lines up with the ToC and the nav items line up with the right sidebar. */ +body.has-toc .navbar .container { + max-width: 1400px; +} + img { max-width: 100%; height: auto; diff --git a/index.php b/index.php index b8ed8cc..eec1f65 100644 --- a/index.php +++ b/index.php @@ -14,13 +14,18 @@ : 'light'; $blowditBg = $blowditThemeBg[$blowditTheme]; $blowditScheme = ($blowditTheme === 'light') ? 'light' : 'dark'; + + // Pre-compute before so we can stamp the has-toc class on it, + // which lets CSS align the navbar container with the wider article container. + $blowditIsArticle = ($WHERE_AM_I === 'page' && isset($page) && !$page->isStatic() && !$url->notFound()); + $blowditHasHeadings = $blowditIsArticle && (bool) preg_match('/content()); ?> - +> @@ -94,10 +99,9 @@ // The hero (and the relocated search) only appear on the blog front page. $heroVisible = ($WHERE_AM_I === 'home' && Paginator::currentPage() == 1); - // True when viewing a single non-static article. - $isArticlePage = ($WHERE_AM_I === 'page' && isset($page) && !$page->isStatic() && !$url->notFound()); - // Show 3-column layout (left ToC + content + right sidebar) only when the article has headings. - $hasHeadings = $isArticlePage && (bool) preg_match('/content()); + // Reuse the values pre-computed before (avoids calling $page->content() twice). + $isArticlePage = $blowditIsArticle; + $hasHeadings = $blowditHasHeadings; ?>