Skip to content

Commit f3d98c4

Browse files
committed
Test redirects
1 parent f2a1182 commit f3d98c4

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-python@v5
1919
with:
2020
python-version: '3.13'
21-
- run: pip install sphinx sphinx_rtd_theme
21+
- run: pip install sphinx sphinx_rtd_theme sphinx-reredirects
2222
- run: make gh-pages
2323
- name: Upload artifact
2424
uses: actions/upload-pages-artifact@v3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM python:3.13-alpine
22

3-
RUN pip install --no-cache-dir sphinx sphinx_rtd_theme sphinx-autobuild
3+
RUN pip install --no-cache-dir sphinx sphinx_rtd_theme sphinx-autobuild sphinx-reredirects

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ livehtml:
1818

1919
gh-pages:
2020
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" $(BUILDDIR)/html/en/latest $(SPHINXOPTS)
21+
# Ensure Jekyll is enabled with correct YAML formatting
22+
printf -- "plugins:\n - jekyll-redirect-from\n" > $(BUILDDIR)/html/_config.yml
23+
# Create redirect for root to /en/latest/
24+
printf -- "---\nredirect_to: /en/latest/\n---\n" > $(BUILDDIR)/html/index.md
25+
# Create redirect for /en/ to /en/latest/
26+
printf -- "---\nredirect_to: /en/latest/\n---\n" > $(BUILDDIR)/html/en/index.md
27+
# Ensure GitHub Pages processes Jekyll
28+
rm -f $(BUILDDIR)/html/.nojekyll
29+
2130
# Catch-all target: route all unknown targets to Sphinx using the new
2231
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2332
%: Makefile

source/conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
# ones.
4343
#
4444
extensions = [
45-
'sphinx.ext.todo'
45+
'sphinx.ext.todo',
46+
'sphinx_reredirects'
4647
]
4748

4849
# Add any paths that contain templates here, relative to this directory.
@@ -121,6 +122,18 @@
121122

122123
html_favicon = 'img/favicon.ico'
123124

125+
redirects = {
126+
"hub/setup/requirements/index": "/hub/deployment.html#hardware-requirements",
127+
"hub/setup/billing/index": "/hub/license.html",
128+
"hub/setup/keycloak-administration/index": "/hub/user-group-management.html",
129+
"hub/setup/index": "/hub/deployment.html",
130+
"hub/access-vault/unlocking-a-vault/4.-vault-unlocked/index": "/hub/access-vault/unlocking-a-vault/vault-unlocked.html",
131+
"hub/access-vault/unlocking-a-vault/3.-add-device/index": "/hub/access-vault/unlocking-a-vault/add-device.html",
132+
"hub/access-vault/unlocking-a-vault/2.-authenticate/index": "/hub/access-vault/unlocking-a-vault/authenticate.html",
133+
"hub/access-vault/unlocking-a-vault/1.-click-unlock/index": "/hub/access-vault/unlocking-a-vault/click-unlock.html",
134+
"desktop/vault-mounting/index": "/desktop/volume-type.html"
135+
}
136+
124137
# -- Options for HTMLHelp output ---------------------------------------------
125138

126139
# Output file base name for HTML help builder.

0 commit comments

Comments
 (0)