diff --git a/en_chapters/frontpage.html b/en_chapters/frontpage.html
new file mode 100644
index 0000000..a658206
--- /dev/null
+++ b/en_chapters/frontpage.html
@@ -0,0 +1,479 @@
+
+
+
+
+
+
+
+
+
+
Core Authors
+
+
+
+

+
+
University of Edinburgh
+
+
+
+
+

+
+
Peking University, Peng Cheng Laboratory
+
+
+
+
+

+
Xuefeng Jin
+
MindSpore Architect
+
+
+
+
+

+
+
MindSpore Architect
+
+
+
+
+
Chapter Authors
+
+
+
+

+
+
Peng Cheng Laboratory
+
+
+
+
+

+
+
Peng Cheng Laboratory
+
+
+
+
+

+
+
University of Edinburgh
+
+
+
+
+

+
+
Tsinghua University
+
+
+
+
+
+

+
+
Princeton University
+
+
+
+
+

+
+
Stanford University
+
+
+
+
+

+
+
Carnegie Mellon University
+
+
+
+
+

+
+
Beijing University of Posts and Telecommunications
+
+
+
+
+

+
+
University of Edinburgh
+
+
+
+
+

+
+
University of Cambridge
+
+
+
+
+

+
+
University of Edinburgh
+
+
+
+
+

+
Qinghua Zhang
+
Huawei Engineer
+
+
+
+
+

+
Zhibo Liang
+
Huawei Engineer
+
+
+
+
+

+
Jianfeng Yu
+
Huawei Engineer
+
+
+
+
+

+
Jinjin Chu
+
Huawei Engineer
+
+
+
+
+
+

+
Fubi Cai
+
Huawei Engineer
+
+
+
+
+

+
Renwei Zhang
+
Huawei Engineer
+
+
+
+
+

+
Chao Liu
+
Huawei Engineer
+
+
+
+
+

+
Gang Chen
+
Huawei Engineer
+
+
+
+
+
+

+
Mingqi Li
+
Huawei Engineer
+
+
+
+
+

+
Gangqiang Han
+
Huawei Engineer
+
+
+
+
+

+
Yehui Tang
+
Huawei Engineer
+
+
+
+
+

+
Zhiqiang Zhai
+
Huawei Engineer
+
+
+
+
+

+
Tiancheng Wu
+
Huawei Engineer
+
+
+
+
+

+
Xiaohui Li
+
Huawei Engineer
+
+
+
+
+

+
Haoyang Li
+
Huawei Engineer
+
+
+
+
+
+

+
Zhipeng Tan
+
Huawei Engineer
+
+
+
+
+

+
Shanni Li
+
Huawei Engineer
+
+
+
+
+

+
Zhijian Guo
+
Huawei Engineer
+
+
+
+
+
+
+
+
+Table of Contents
+
+
+
+
diff --git a/tests/test_prepare_mdbook.py b/tests/test_prepare_mdbook.py
index ffcdf1d..5441ae5 100644
--- a/tests/test_prepare_mdbook.py
+++ b/tests/test_prepare_mdbook.py
@@ -144,6 +144,45 @@ Reference :cite:`smith2024`.
self.assertIn('href="cn/"', rewritten)
self.assertIn(">中文", rewritten)
+ def test_rewrite_markdown_prefers_book_local_frontpage_file(self) -> None:
+ with tempfile.TemporaryDirectory() as tmpdir:
+ root = Path(tmpdir)
+ source = root / "en_chapters"
+ static_dir = source / "static"
+ source.mkdir()
+ static_dir.mkdir()
+
+ index = source / "index.md"
+ index.write_text(
+ """# Home
+
+```eval_rst
+.. raw:: html
+ :file: frontpage.html
+```
+""",
+ encoding="utf-8",
+ )
+ (source / "frontpage.html").write_text(
+ "English frontpage
\n",
+ encoding="utf-8",
+ )
+ (static_dir / "frontpage.html").write_text(
+ "Chinese fallback
\n",
+ encoding="utf-8",
+ )
+
+ rewritten = rewrite_markdown(
+ index.read_text(encoding="utf-8"),
+ index.resolve(),
+ {index.resolve(): "Home"},
+ )
+
+ self.assertIn("English frontpage", rewritten)
+ self.assertNotIn("Chinese fallback", rewritten)
+ self.assertIn("background: transparent !important;", rewritten)
+ self.assertIn("padding: 0 !important;", rewritten)
+
def test_regular_page_does_not_render_frontpage_switch(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
root = Path(tmpdir)
diff --git a/tools/prepare_mdbook.py b/tools/prepare_mdbook.py
index d094bd4..a90b4a7 100644
--- a/tools/prepare_mdbook.py
+++ b/tools/prepare_mdbook.py
@@ -91,6 +91,8 @@ FRONTPAGE_LAYOUT_CSS = """
.openmlsys-frontpage img {
max-width: 100%;
height: auto;
+ background: transparent !important;
+ padding: 0 !important;
}
#content,
.content {