Skip to content

Commit 9072c06

Browse files
committed
use redirects instead of page builds
1 parent 309fc09 commit 9072c06

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

conf.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,22 @@
4545
]
4646

4747
redirects = {
48-
"tools/index": "../resources/tools/index.html",
49-
"publications/index": "../resources/publications/index.html",
50-
"data/index": "../resources/data/index.html",
51-
"about/index": "../index.html"
48+
"tools/index": "../resources/tools/index.html",
49+
"publications/index": "../resources/publications/index.html",
50+
"data/index": "../resources/data/index.html",
51+
"about/index": "../index.html",
52+
"0.1/index": "../specifications/0.1/index.html",
53+
"0.1/": "../specifications/0.1/index.html",
54+
"0.2/index": "../specifications/0.2/index.html",
55+
"0.2/": "../specifications/0.2/index.html",
56+
"0.3/index": "../specifications/0.3/index.html",
57+
"0.3/": "../specifications/0.3/index.html",
58+
"0.4/index": "../specifications/0.4/index.html",
59+
"0.4/": "../specifications/0.4/index.html",
60+
"0.5/index": "../specifications/0.5/index.html",
61+
"0.5/": "../specifications/0.5/index.html",
62+
"Dev/index": "../specifications/Dev/index.html",
63+
"Dev/": "../specifications/Dev/index.html"
5264
}
5365

5466
# -- Options for HTML output -------------------------------------------------
@@ -119,23 +131,6 @@ def build_served_html():
119131
if os.path.exists(bikeshed_output):
120132
shutil.copy2(bikeshed_output, f'_html_extra/{version}/index.html')
121133
print(f'✅ Found legacy bikeshed, serving as extra html for {version}')
122-
else:
123-
myst_dir = os.path.dirname(myst_file)
124-
cmd = [sys.executable, '-m', 'jupyter_book', 'build', '--ci', '--html']
125-
proc = subprocess.run(cmd, cwd=myst_dir, capture_output=True, text=True)
126-
print(f"Running: {' '.join(cmd)} in {myst_dir}")
127-
if proc.stdout:
128-
print(proc.stdout)
129-
if proc.stderr:
130-
print(proc.stderr)
131-
proc.check_returncode()
132-
print('✅ Built jupyter-book documentation for version', version)
133-
134-
build_dirs = glob.glob(f'specifications/{version}/**/_build/html', recursive=True)
135-
if not build_dirs:
136-
raise FileNotFoundError(f'No build directory found for version {version}')
137-
shutil.copytree(build_dirs[0], f'_html_extra/{version}', dirs_exist_ok=True)
138-
print(f'✅ Copied jupyter-book documentation as extra html for {version}')
139134
except Exception as e:
140135
print(f'⚠️ Could not copy served html for version {version}: {e}')
141136

0 commit comments

Comments
 (0)