Skip to content

Commit c766eed

Browse files
committed
attempt version switcher
1 parent a29b203 commit c766eed

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,6 @@ jobs:
7070
- name: Copy versions.json to build output
7171
run: cp docs/versions.json docs/_build/
7272

73-
- name: Create 404 page for GitHub Pages
74-
if: ${{ github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
75-
run: |
76-
# Create a symlink of the 404.html file in the root directory for GitHub Pages
77-
# This ensures that the 404 page is used for all missing pages across all versions
78-
cp docs/_build/404.html docs/_build/404.html.bak
79-
cat <<EOF > docs/_build/404.html
80-
<!DOCTYPE html>
81-
<html>
82-
<head>
83-
<meta charset="UTF-8">
84-
<meta http-equiv="refresh" content="0; url=./latest/404.html">
85-
<title>Page Not Found</title>
86-
</head>
87-
<body>
88-
<p>If you are not redirected automatically, follow this <a href="./latest/404.html">link to the 404 page</a>.</p>
89-
</body>
90-
</html>
91-
EOF
92-
# Restore the original 404.html in the version directory
93-
mv docs/_build/404.html.bak docs/_build/404.html
94-
9573
- name: Create redirect index.html
9674
if: ${{ github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
9775
run: |

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"icon": "fa-solid fa-box",
5858
},
5959
],
60+
"navbar_start": ["navbar-logo", "version-switcher"],
6061
"external_links": [
6162
{"name": "xarray", "url": "https://xarray.pydata.org/"},
6263
],

0 commit comments

Comments
 (0)