From b23ea90d90521f4615a2f607f49bc8151d31da0e Mon Sep 17 00:00:00 2001 From: cydia2001 Date: Wed, 11 Mar 2026 01:57:47 +0000 Subject: [PATCH] fix: widen centered homepage container Keep the homepage frontpage wrapper centered while ensuring it uses at least 80% of the available content area, without changing normal body page layout. --- tests/test_prepare_mdbook.py | 2 +- tools/prepare_mdbook.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_prepare_mdbook.py b/tests/test_prepare_mdbook.py index 3a5324a..fec8cf3 100644 --- a/tests/test_prepare_mdbook.py +++ b/tests/test_prepare_mdbook.py @@ -192,7 +192,7 @@ Reference :cite:`smith2024`. self.assertIn("padding: 0 !important;", rewritten) self.assertIn("border-radius: 6px;", rewritten) self.assertIn("background: #f6f8fa;", rewritten) - self.assertIn("max-width: var(--content-max-width);", rewritten) + self.assertIn("width: min(100%, max(80%, var(--content-max-width)));", rewritten) self.assertIn("margin-inline: auto;", rewritten) def test_regular_page_does_not_render_frontpage_switch(self) -> None: diff --git a/tools/prepare_mdbook.py b/tools/prepare_mdbook.py index 716d1bb..2fd9f7d 100644 --- a/tools/prepare_mdbook.py +++ b/tools/prepare_mdbook.py @@ -25,8 +25,7 @@ FRONTPAGE_SWITCH_PLACEHOLDER = "" FRONTPAGE_LAYOUT_CSS = """