Use redirect instead of copy for index file

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-11-09 14:23:01 +01:00
1 parent 90f50fe638
commit 4ac6d59e6c
3 files changed
+2 -11

No files matched your search

-1
View File
@@ -2,4 +2,3 @@
/jupyter_execute
/conf.py
/_build
/index.md
-10
View File
@@ -1,16 +1,6 @@
import os
from pathlib import Path
# Copy 01-about/000_intro.md to index.md
# We want the intro to the first chapter to also be the intro to the book,
# and it doesn't seem to be easily possible to get rid of an index file entirely.
directory = Path(__file__).parent
with open(directory / "01-about/000_intro.md", "r", encoding="utf-8") as src:
intro_content = src.read()
with open(directory / "index.md", "w", encoding="utf-8") as dst:
dst.write("<!-- This is a copy of 01-about/000_intro.md; DO NOT EDIT -->\n\n")
dst.write(intro_content)
# This script provides a platform-independent way of making the jupyter-book call (used in pyproject.toml)
folder = Path(__file__).parent
toc_file = folder / "_toc.yml"
+2
View File
@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; url=01-about/000_intro.html">
If you are not redirected automatically, [click here](01-about/000_intro.html).