Align navbar container with wider article layout for improved consistency

This commit is contained in:
interlope committed 2026-05-29 18:07:23 +02:00
1 parent 25d7a7a5d2
commit 3bc9f8ce36
2 files changed
+15 -5

No files matched your search

+6
View File
@@ -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;
+9 -5
View File
@@ -14,13 +14,18 @@
: 'light';
$blowditBg = $blowditThemeBg[$blowditTheme];
$blowditScheme = ($blowditTheme === 'light') ? 'light' : 'dark';
// Pre-compute before <body> 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('/<h[234]/i', $page->content());
?>
<!DOCTYPE html>
<html lang="<?php echo Theme::lang() ?>" data-theme="<?php echo $blowditTheme ?>" style="background-color: <?php echo $blowditBg ?>; color-scheme: <?php echo $blowditScheme ?>;">
<head>
<?php include(THEME_DIR_PHP.'head.php'); ?>
</head>
<body>
<body<?php echo $blowditHasHeadings ? ' class="has-toc"' : ''; ?>>
<!-- Load Bludit Plugins: Site Body Begin -->
<?php Theme::plugins('siteBodyBegin'); ?>
@@ -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('/<h[234]/i', $page->content());
// Reuse the values pre-computed before <body> (avoids calling $page->content() twice).
$isArticlePage = $blowditIsArticle;
$hasHeadings = $blowditHasHeadings;
?>
<!-- Content -->