From dcb31df2ca0423717c178df9732f64d999c41bb5 Mon Sep 17 00:00:00 2001 From: cydia2001 Date: Wed, 11 Mar 2026 01:49:07 +0000 Subject: [PATCH] fix: center homepage content container Align the English and Chinese homepage frontpage wrapper with the main content container so homepage content is centered like normal body content. --- tests/test_prepare_mdbook.py | 2 ++ tools/prepare_mdbook.py | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/test_prepare_mdbook.py b/tests/test_prepare_mdbook.py index 69973df..98d330f 100644 --- a/tests/test_prepare_mdbook.py +++ b/tests/test_prepare_mdbook.py @@ -192,6 +192,8 @@ 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("margin-inline: auto;", rewritten) def test_regular_page_does_not_render_frontpage_switch(self) -> None: with tempfile.TemporaryDirectory() as tmpdir: diff --git a/tools/prepare_mdbook.py b/tools/prepare_mdbook.py index 894a4c3..716d1bb 100644 --- a/tools/prepare_mdbook.py +++ b/tools/prepare_mdbook.py @@ -26,7 +26,9 @@ FRONTPAGE_LAYOUT_CSS = """