Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Commit 8680c0d

Browse files
committed
Replace book with redirects to new site
1 parent f9f2386 commit 8680c0d

11 files changed

Lines changed: 156 additions & 33 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
# This file was created automatically with `myst init --gh-pages` 🪄 💚
2-
# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**.
1+
# Deploys redirect pages to forward visitors to the new book location
2+
# Old: https://poldrack.github.io/BetterCodeBetterScience/
3+
# New: https://bettercodebetterscience.github.io/book/
34

4-
name: MyST GitHub Pages Deploy
5+
name: Deploy Redirects to GitHub Pages
56
on:
67
push:
7-
# Runs on pushes targeting the default branch
88
branches: [main]
9-
env:
10-
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
11-
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
12-
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
13-
BASE_URL: /${{ github.event.repository.name }}
149

1510
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1611
permissions:
1712
contents: read
1813
pages: write
1914
id-token: write
20-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
15+
16+
# Allow only one concurrent deployment
2217
concurrency:
2318
group: 'pages'
2419
cancel-in-progress: false
20+
2521
jobs:
2622
deploy:
2723
environment:
@@ -32,31 +28,10 @@ jobs:
3228
- uses: actions/checkout@v4
3329
- name: Setup Pages
3430
uses: actions/configure-pages@v3
35-
- uses: actions/setup-node@v4
36-
with:
37-
node-version: 18.x
38-
- name: Install MyST
39-
run: npm install -g mystmd
40-
- name: Build HTML Assets
41-
run: myst build --html
42-
- name: Create redirect from frontmatter to index
43-
run: |
44-
cat > ./_build/html/frontmatter.html << 'EOF'
45-
<!DOCTYPE html>
46-
<html>
47-
<head>
48-
<meta http-equiv="refresh" content="0; url=./index.html">
49-
<link rel="canonical" href="./index.html">
50-
</head>
51-
<body>
52-
<p>Redirecting to <a href="./index.html">index page</a>...</p>
53-
</body>
54-
</html>
55-
EOF
5631
- name: Upload artifact
5732
uses: actions/upload-pages-artifact@v3
5833
with:
59-
path: './_build/html'
34+
path: './_redirects'
6035
- name: Deploy to GitHub Pages
6136
id: deployment
6237
uses: actions/deploy-pages@v4

_redirects/404.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Redirecting to Better Code, Better Science</title>
7+
<script>
8+
(function() {
9+
// Get the current path (e.g., /BetterCodeBetterScience/testing/)
10+
var path = window.location.pathname;
11+
12+
// Remove the old base path if present
13+
var oldBase = '/BetterCodeBetterScience';
14+
if (path.startsWith(oldBase)) {
15+
path = path.substring(oldBase.length);
16+
}
17+
18+
// Ensure path starts with /
19+
if (!path.startsWith('/')) {
20+
path = '/' + path;
21+
}
22+
23+
// Build the new URL
24+
var newUrl = 'https://bettercodebetterscience.github.io/book' + path;
25+
26+
// Preserve any hash or query string
27+
newUrl += window.location.search + window.location.hash;
28+
29+
// Redirect
30+
window.location.replace(newUrl);
31+
})();
32+
</script>
33+
<noscript>
34+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/">
35+
</noscript>
36+
</head>
37+
<body>
38+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/">Better Code, Better Science</a>...</p>
39+
</body>
40+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/acknowledgments/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/acknowledgments/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/acknowledgments/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/ai-coding-assistants/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/ai-coding-assistants/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/ai-coding-assistants/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/data-management/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/data-management/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/data-management/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/essential-tools-and-techniques/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/essential-tools-and-techniques/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/essential-tools-and-techniques/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>

_redirects/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>

_redirects/introduction/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/introduction/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/introduction/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/introduction/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/project-organization/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/project-organization/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/project-organization/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://bettercodebetterscience.github.io/book/software-engineering/">
6+
<link rel="canonical" href="https://bettercodebetterscience.github.io/book/software-engineering/">
7+
<title>Redirecting to Better Code, Better Science</title>
8+
</head>
9+
<body>
10+
<p>This site has moved. Redirecting to <a href="https://bettercodebetterscience.github.io/book/software-engineering/">Better Code, Better Science</a>...</p>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)