8000 MAINT Adds sphinx configuration for redirections (#20625) · scikit-learn/scikit-learn@01a28e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 01a28e9

Browse files
authored
MAINT Adds sphinx configuration for redirections (#20625)
1 parent f2f8b52 commit 01a28e9

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

doc/conf.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@
182182

183183
# Additional templates that should be rendered to pages, maps page names to
184184
# template names.
185-
html_additional_pages = {
186-
"index": "index.html",
187-
"documentation": "documentation.html",
188-
} # redirects to index
185+
html_additional_pages = {"index": "index.html"}
189186

190187
# If false, no module index is generated.
191188
html_domain_indices = False
@@ -232,6 +229,19 @@
232229
highlight_version = ".".join(latest_highlights.split("_")[-3:-1])
233230
html_context["release_highlights_version"] = highlight_version
234231

232+
233+
# redirects dictionary maps from old links to new links
234+
redirects = {
235+
"documentation": "index",
236+
"auto_examples/feature_selection/plot_permutation_test_for_classification": (
237+
"auto_examples/model_selection/plot_permutation_tests_for_classification"
238+
),
239+
}
240+
html_context["redirects"] = redirects
241+
for old_link in redirects:
242+
html_additional_pages[old_link] = "redirects.html"
243+
244+
235245
# -- Options for LaTeX output ------------------------------------------------
236246
latex_elements = {
237247
# The paper size ('letterpaper' or 'a4paper').
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
{% set redirect = pathto(redirects[pagename]) %}
12
<!DOCTYPE html>
23
<html>
34
<head>
45
<meta charset="utf-8">
56
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<meta http-equiv="Refresh" content="0; url={{ pathto('index') }}" />
7+
<meta http-equiv="Refresh" content="0; url={{ redirect }}" />
78
<meta name="Description" content="scikit-learn: machine learning in Python">
8-
<link rel="canonical" href="{{ pathto('index') }}" />
9+
<link rel="canonical" href="{{ redirect }}" />
910
<title>scikit-learn: machine learning in Python</title>
1011
</head>
1112
<body>
12-
<p>You will be automatically redirected to the <a href="{{ pathto('index') }}">main page</a>.</p>
13+
<p>You will be automatically redirected to the <a href="{{ redirect }}">new location of this page</a>.</p>
1314
</body>
1415
</html>

examples/feature_selection/plot_permutation_test_for_classification.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0