Skip to content

Commit 5aebc0b

Browse files
authored
Blog on redirects (#543)
1 parent 569328c commit 5aebc0b

File tree

1 file changed

+42
-0
lines changed
  • content/blog/2025/jb1-redirect-generator

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: "Creating a re-usable redirect generator for Jupyter Book 1 migrations"
3+
date: "2025-11-12"
4+
authors:
5+
- Chris Holdgraf
6+
categories:
7+
- upstream-impact
8+
tags:
9+
- learning
10+
- open-source
11+
- jupyterbook
12+
---
13+
14+
When migrating documentation from [Jupyter Book](/collaborators/jupyter-book/) 1 to Jupyter Book 2, URL structures change dramatically and break external links. We spent some time createing a re-usable tool to solve this problem across multiple projects.
15+
16+
You can check out the tool below:
17+
18+
https://github.com/jupyter-book/jb1-redirect-generator
19+
20+
It's designed to be run in a self-contained way by putting the dependencies in `script` metadata at the top.
21+
This means you can run it like this:
22+
23+
```bash
24+
uv run https://raw.githubusercontent.com/jupyter-book/jb1-redirect-generator/main/generate_redirects.py
25+
```
26+
27+
This let's you generate redirects from JB1 -> JB2 URL structures and dump them in a `_build/html` folder with your JB2 built pages.
28+
29+
We tested this out by converting the [Jupyter Governance docs](https://jupyter.org/governance) to Jupyter Book 2 and running it there.
30+
You can find a noxfile that runs these commands here:
31+
32+
https://github.com/jupyter/governance/blob/bcdae30efdecbe75bc4751ef1fe1e602fe82ee10/noxfile.py#L25-L37
33+
34+
And its use in a GitHub Workflow here:
35+
36+
https://github.com/jupyter/governance/blob/bcdae30efdecbe75bc4751ef1fe1e602fe82ee10/.github/workflows/deploy.yml#L39-L44
37+
38+
## Learn more
39+
40+
- [jb1-redirect-generator repository](https://github.com/jupyter-book/jb1-redirect-generator)
41+
- [Jupyter governance PR using the new script](https://github.com/jupyter/governance/pull/307)
42+

0 commit comments

Comments
 (0)